[MAGNOLIA-4432] Add function to retrieve node based on UUID? Created: 04/Jun/12  Updated: 04/Jun/12  Resolved: 04/Jun/12

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 4.5.3
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Edgar Vonk Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
duplicates MAGNOLIA-4400 templating: introduce a possibility t... Closed
Template:
Acceptance criteria:
Empty

 Description   

Hi,

It could be that we are overlooking something but we cannot seem to find an easy way to get to a (page) node from the UUID anymore in the new Magnolia templating API / taglibs. Neither the FTL nor the JSP version. Can this functionality be added to the taglibs? cmsfn:link seems to be the only function that still takes a UUID.

Situation: we store internal links as UUID fields (not paths). In the old (pre 4.5) API it was easy to retrieve the node that the link points to in order to get this node's children etc. In the new API (FTL example below) we now have to get the link and then strip the context path and extension from it and use the resulting path to get the node. There must be an easier way?

    [#assign contextlink = cmsfn.link('website',content.start?string)]
    [#assign serviceMenuParentPath = (contextlink?replace("."+state.extension,""))?replace(ctx.contextPath,"")]
    [#assign serviceMenuParentNode = cmsfn.content('website',serviceMenuParentPath)]   
    [#if serviceMenuParentNode?has_content] 
    <ul class="nav"> 	
      [#list cmsfn.children(serviceMenuParentNode) as serviceMenuNode]
         [#assign serviceMenuPage = cmsfn.asContentMap(serviceMenuNode)]
	 [#assign serviceMenuPageLink = cmsfn.link(serviceMenuPage)!]
[..]

Also reported in SUPPORT-1448.


Generated at Mon Feb 12 03:55:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.