Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-4432

Add function to retrieve node based on UUID?

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Neutral Neutral
    • None
    • 4.5.3
    • taglibs
    • None

      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.

        Acceptance criteria

              Unassigned Unassigned
              edgar Edgar Vonk
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: