MultiplePagePickerViaSource

March 29th, 2006

I have created a new Data Type to use in umbraco, different people on the umbraco mailing list requested this kind of Data Type.
I use this a Data Type like this on a regularly basis and with big pleasure in Sitecore CMS, therefore it was naturally for me to make this to umbraco.

Download (All files needed to use MultiplePagePickerViaSource in umbraco) 12 KB
Download source (Visual Studio 2003 project) 28 KB

In short the MultiplePagePickerViaSource is a Data Type where you can select multiple children of a given page in the site structure you can also sort the selected pages.

See the screenshot to get a better understanding

Cropped thumbnails of screenshots in random order, click in the thumbnails to see the screenshot in full size

screenshot 01

MPPicker_screenshot02_thumb

MPPicker_screenshot03_thumb

MPPicker_screenshot04_thumb

There are many ways of using the MultiplePagePickerViaSource in umbraco, let me try to give you some examples:

1. Blog categories
You could use the MultiplePagePickerViaSource to select multiple blog categories to a page/post, just use the id of the mother to the blog categories.

2. Meta tags (Category)
You can create your meta tag categories in the site structure, just because the are in the site structure the don’t have to be browsable on the website. This way a normal editor can create categories, no need to edit prevalues etc.

I could go on and on, but please leave a comment on have you are using the MultiplePagePickerViaSource in umbraco.

Install
Download (Link is in the top of this post).
Copy the two folders to your site.

How to use
Now you should be able to setup a new Data Type to use CPalm.MultiplePagePickerViaSource in the Developer section of umbraco.
When you are using the CPalm.MultiplePagePickerViaSource Data Type in a Document Type is it important to tell the Data Type where to pickup childs (Pages).
You are doing this by using the field “Description” on the property, you should write the ID of the mother of the childs you want to get listed.

Example xslt on using it
MultiplePagePickerViaSource.xslt

Please be aware that the xslt function umbraco.library:Split is included in umbraco version 2.1.1+

Web.Config
Please be aware that you do not need to add these settings to web.config, it is optional and not required.

If you can’t place the javascript file, it the default location you can change the location via the key MultiplePagePickerViaSource_JavascriptSrc
add key=”MultiplePagePickerViaSource_JavascriptSrc” value=”/myscript/MultiplePagePickerViaSource.js”/

I have included a .net check to se if the javascript file is present, this way you don’t get strange javascript errors but a .net exception.
You can skip this check via the key MultiplePagePickerViaSource_Skip_System.IO.File.Exists_Check
add key=”MultiplePagePickerViaSource_Skip_System.IO.File.Exists_Check” value=”true”/
The check is cached for performance.

Final notes
It’s was actually quite simple to make this Data Type.

85% of the time spent on this project was used on documentation, screenshot, preparing code for download etc.
15% on actually coding (the funny part)

No wonder why documentation some times halts on open source projects

Drinking: Aldi Gold Coffee
Listening to: Rasmus Nør

Tags: Umbraco, Umbraco Extension

Comments

#1 - Heather Floyd on July 24, 2006 22:57

Great control. Is it possible to use it to select multiple media items rather than content pages?
Heather

#2 - Christian Palm on July 24, 2006 23:14

For now you can not use it to select media items.
But it is a great idea, maybe I will make "multiple media items" for umbraco 3.0

The lack with this control for media items, is that you can only select media items beneath one folder, A better way would to make some kind of tree in the left selectbox

#3 - Greg on August 01st, 2006 10:27

I want to create a music database... it will contain an artist table (with artist info), a release table (with cd releases info), a label table (with record label info), and the tables will need to be linked by foreign keys etc... is this possible with your component, or umbraco itself, or should i be creating this component in .NET and integrating into umbraco??

any advice appreciated :)

ps: this comment system rocks! love your work

#4 - Christian Palm on August 01st, 2006 10:51

#3
Yes you can do this with umbraco.
Mayby you should do a post in the umbraco forum forum.umbraco.org

I would properly do it like this
-Home
--Artist
----John
------First Cd
------Second CD
----Bill
------First Cd
------Second CD
--Labels
----O Records
----LabelTwo

Then you only need to do a key from Artist to Label and you dont need the MultiplePagePickerViaSource

If more artist could be joined in more releases then you would properly need the MultiplePagePickerViaSource and make the structure like this:
-Home
--Artist
----John
--Releases
----FirstCd
--Labels
----O records

Then you could use the MultiplePagePickerViaSource to bind a artist to a release

#5 - Greg on August 02nd, 2006 11:29

thanks CP... that all sounds quite feasable. Still unsure as to whether i'll build my own user control or do it in Umbraco.. i'm tempted to build it myself and integrate it... will be more flexible for me then. still working out how to integrate etc... i think i'm getting a little ahead of myself.. guess i should learn to crawl before trying to run a marathon hey?

ehehe

#6 - Mailand on September 17, 2006 23:17

Hi - this control is really awesome. It's being heavy used on http://webstatus.dk to control the right column boxes. A really "must-have" when creating pages like this! :-)

#7 - Marc on October 13rd, 2006 16:50

How about being able to pick external url's? I have a need for such a control where you would be able to pick internal pages and add external url's... or perhaps now that you created the multiplemediapicker create a third one... (Or is there some trick in Umbraco I could use? And I mean not creating a 'link' document type and simply add that below the node... that would visually impair the tree if you'd ask me...)

Keep up the good work!!!!

#8 - Marc on January 24, 2007 05:52

The way we handle related links, Marc, is to create a Data tree (separate to the website tree), and under there have categories like News Items, External Links, etc... like you said creating a link doc type, but keeping the links nodes ina separate tree to the actual content, so they can be reused across the site (entered via a page picker).

#9 - Kenneth Solberg on February 10, 2007 01:55

Nice one! Would be really cool if it (optionally) could be recursive from the offset node.

#10 - Vandan on March 01st, 2007 14:01

This is really a very helpful control for my application. Can some one help me out with creating the XSLT for this to render this as links... kind of stuck with that. Am very new to XSLT and XML and i am running in to all sorts of problems..

#11 - Gísli Guðnason on March 19, 2007 20:41

I uploaded all files to my server but I am unable to create a new data type with your type. It does not load. I'm working with a beta version of 3

#12 - Alec Griffiths on April 12nd, 2007 01:17

We use this very useful control thanks. Question: Is there a way of making this a single page picker? I know that may not make too much sense but we would like a basic content picker that only picks one content item within either a node tree or a particular document type.

#13 - Jason on April 20, 2007 17:21

Great control. I think I'm having a javascript issue when including this control on a tab with other controls. In these cases, the multipagepicker 'incorporates' the other controls on the tab as well as the controls on other tabs. For example if I have two tabs: On the first is the multipagepicker and a textstring control and on the second is a richtextarea. When saving, the returned page contains all the controls from both tabs (the second tab is now empty) and the textstring control is displayed within the multipagepicker presenation box. Kinda weird....anyone else getting this? Any ideas Christian?

#14 - Greg on May 02nd, 2007 08:30

Alec, there is a single content picker as default in Umbraco - which renders the site tree and is browseable... but what it can't do unfortunately is start at a specific parent node - that'd be a good enhancement to add to the generic content picker... anybody ;)

#15 - Michal on June 04, 2007 10:03

i have the same problem as Gísli Guðnason. Please respond me, if this library work in V3, because i copied files into right directories, but it is not possible create data type.

#16 - Kenneth Solberg on June 12nd, 2007 11:13

Tried on RC2, datatype not showing up.

#17 - Morten Bock on June 14, 2007 13:19

I get the same error as Jason (Aprils 20). It seems that it seems that when publishing when there is no nodes selected causes a Null reference error that is output in the middle of the selectbox, causing the html of the tabs to break.

#18 - Morten Bock on June 16, 2007 20:42

Just wanted to let you know that I created a version of the datatype that works in V3 RC2 and also fixes the null reference bug mentioned above.

Get it here: <a href="http://www.mortenbock.dk/updated-cpalm-multiple-page-picker-for-v3-bugfix-57.htm">http://www.mortenbock.dk/updated-cpalm-multiple-page-picker-for-v3-bugfix-57.htm</a>

#19 - Alex on July 11st, 2007 05:38

Excellent control, is there any way of making the links reciprocal, so that the articles you link to in the MultiplePagePickerViaSource also contain a link back to the article in which the MultiplePagePickerViaSource is placed into?

#20 - Alec Griffiths on February 25, 2008 12:35

"is there any way of making the links reciprocal"
this can be done with XSLT, by searching a node tree for an atribute with the ID of the referancing node:

<xsl:variable name="matching" select="umbraco.library:GetXmlAll()//node[./@id = '1050']//node[./@nodeTypeAlias = $nodeType and count(umbraco.library:Split(./data[@alias = $nodeMetaDataAttrib], ',')/value[. = $nodeID]) &gt; 0]" />

#21 - buy propecia on December 06, 2009 23:10

Nice blog! U really use Umbraco RSS package? What functions it's has?

#22 - music download legally on December 07, 2009 10:49

Nice blog! What functions it's has? U really use Umbraco RSS package?

#23 - HIre a car in Ukraine on February 11st, 2010 17:21

HIre a car in Ukraine

 

Create a new comment

Recent Post

Tags