|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
Sorry, that's the best title I could come up with.
I want content editors to be able to create a select list for any page. I'd like them to be able to do this by right clicking any content node and adding a list, then a list group, then the individual list items.
This would mean they can create an infinite number of list items that would then show up in any page and I only need to create one XSLT template to enable this.
I've created the content types an XSLT file to create the list and a macro to embed it in any template. All well and fine.
However, when creating these list nodes, these also result in a 'Link to document' .aspx being created. It's a block of content to be used by the parent node, not a page. How can I stop this page being created?
I could put all the link properties into the document type for every page but I can tell you, that is NOT a workable solution.
Richard
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
Here's more particular detail.
In my currentPage there is the following XML (there are several similar groups):
<node id="1214" version="8fb6273b-aa5f-4f9d-a569-c3f51d2a0551" parentID="1213" level="4" writerID="0" creatorID="0" nodeType="1205" template="0" sortOrder="1" createDate="2008-02-29T11:17:06" updateDate="2008-03-03T11:28:56" nodeName="link 1 name" urlName="link-1-name" writerName="Administrator" creatorName="Administrator" nodeTypeAlias="QuickLink" path="-1,1136,1209,1213,1214"> <data alias="LinkURL"/> </node> <node id="1215" version="68c01535-2910-49c0-b628-9ebb345eb1d9" parentID="1213" level="4" writerID="0" creatorID="0" nodeType="1205" template="0" sortOrder="2" createDate="2008-02-29T11:17:17" updateDate="2008-03-03T11:28:56" nodeName="link 2 name" urlName="link-2-name" writerName="Administrator" creatorName="Administrator" nodeTypeAlias="QuickLink" path="-1,1136,1209,1213,1215"> <data alias="LinkURL"/> </node> <node id="1216" version="b6010f7a-1fba-4c84-9464-26532a7f9534" parentID="1213" level="4" writerID="0" creatorID="0" nodeType="1205" template="0" sortOrder="3" createDate="2008-02-29T11:17:28" updateDate="2008-03-03T11:28:56" nodeName="link 3 name" urlName="link-3-name" writerName="Administrator" creatorName="Administrator" nodeTypeAlias="QuickLink" path="-1,1136,1209,1213,1216"> <data alias="LinkURL"/> </node> <node id="1217" version="1faae2a0-139d-407e-9847-5109d3ba1331" parentID="1213" level="4" writerID="0" creatorID="0" nodeType="1205" template="0" sortOrder="4" createDate="2008-02-29T11:17:37" updateDate="2008-03-03T11:28:56" nodeName="link 4 name" urlName="link-4-name" writerName="Administrator" creatorName="Administrator" nodeTypeAlias="QuickLink" path="-1,1136,1209,1213,1217"> <data alias="LinkURL"/> </node>
The LinkURL alias was created by selecting a link through the Content Picker.
I want to display the links.
<ul class="LinksList"> <xsl:for-each select="descendant::node[@nodeTypeAlias = 'QuickLink']"> <li><a href="{umbraco.library:NiceUrl(data[@alias='QuickLinkURL'])}"><xsl:value-of select="@nodeName" disable-output-escaping="yes"/></a></li> </xsl:for-each> </ul>
I can get the link name out no worries but trying to get Umbraco to give me the URL results in:
Error occured System.Xml.XPath.XPathException: Function 'umbraco.library:NiceUrl()' has failed. ---> System.OverflowException: Value was either too large or too small for an Int32.
Cue much wailingn and gnashing of teeth. Any ideas? Thanks.
Richard
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
Richard Weeks wrote: Here's more particular detail.
Crap, that should have been a new topic. Sorry.
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
 Rank: Fanatic
Joined: 7/20/2006 Posts: 488 Location: NL
|
Try: Code: umbraco.library:NiceUrl(@id)
Working on an events-calendar with recursion. Post requests on my blog!
|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
That doesn't work (and this is I think a very particular issue for Umbraco).
I need the URL chosen in the content picker, not the URL of the page that held the content picker in the first place (which is what the above gives me).
That was why I was asking about the automatic page creation in the first post - I'm not creating a page, just a little snippet of content with a title and a page chosen in a content picker that can be embedded into a web page.
I'll post the whole thing if I ever get it working as it's essentially a jQuery-driven multiple-category list of links that shows 4 links for each category chosen in a dropdown list - and the whole thing can be created in the content menu by page editors.
All working bar this darned URL!! I can see the data alias "QuickLinkURL" for the content picker that I assigned in a Document Type but I can't get my dirty hands on the value behind it...
Richard
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
 Rank: Fanatic
Joined: 7/20/2006 Posts: 488 Location: NL
|
Ah, now it makes sence to me. I'm sorry for the other post then because I didnt understand you right.
If you display the QuickLinkURL, does it show a number for each nodeName or does it show empty strings?
Working on an events-calendar with recursion. Post requests on my blog!
|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
Hi, thanks for your reply, no worries. This is where there's obviously something I'm not getting. Look at the xml fragment for the link: Code:<node id="1230" version="475b41a8-36bb-48b4-a7cd-205c146ff8dd" parentID="1226" level="5" writerID="0" creatorID="0" nodeType="1205" template="0" sortOrder="4" createDate="2008-02-29T11:19:52" updateDate="2008-03-03T11:28:58" nodeName="Quick Link (3)" urlName="quick-link-(3)" writerName="Administrator" creatorName="Administrator" nodeTypeAlias="QuickLink" path="-1,1136,1209,1210,1226,1230"> <data alias="QuickLinkURL"/> </node> I even remembered to put it in code :) Somewhere in amongst that lot must be a way for me to track down the URL that was actually chosen in the Content Picker. I've been through all 3.5 pages of Google results and I'm none the wiser... How on Earth can it be so hard to find out how to use a built in control..? Richard
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
 Rank: Fanatic
Joined: 7/20/2006 Posts: 488 Location: NL
|
Well, the content-picker does not store a complete URL, but just the node-id of the chosen Node.
But, as I look at your XML, the property is empty, so no node was chosen in the content-picker. Therefor it also cannot create a proper link to the document as there is no ID to generate the URL for. Did you add the content-picker as property in your document-type?
I hope I make some sence here......
Working on an events-calendar with recursion. Post requests on my blog!
|
|
 Rank: Fanatic
Joined: 9/17/2007 Posts: 264 Location: London, UK.
|
That was well spotted but not the problem. I copied that snippet from Stylus Studio, which was using an earlier copy.
Anyway, I got it!
<li><a href="{umbraco.library:NiceUrl(data [@alias = 'QuickLinkURL'])}"><xsl:value-of select="@nodeName" disable-output-escaping="yes"/></a></li>
I maintain it shouldn't be so much trouble :no: Bring on the 3.0.3 documentation guys! :w00t:
Richard
2 * 3 * 3 * 37 : The prime factorisation of The Beast.
|
|
|
Guest |