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

editBar contentNodeCollectionName; fileSrc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 1.1
    • core, taglibs
    • None

    Description

      Hello List!

      I faced a strange bug (or maybe I just can't understand the way it works) while
      I was operating with <cms:editBar> and <cmsu:fileSrc tags>

      I've got a ContentNode object on my page. (It contents a node form the collection)
      I want to display a editBar for this node and the contents of the node (just
      output the single node from a collection)

      First I thought to use the ContentNodeIterator and check there the Name property
      in each node to filter "My" node, but I think it's not really optimal way (it
      takes time and not very cute)

      So I tried to get the editBar this way:
      <cms:editBar contentNodeName="<%=myNode.getName()%>"
      contentNodeCollectionName="some_name" parFile="/para.xml" />

      It crashed (I saw lovely blank page) - I think the reason was in
      contentNodeCollectionName attribute,
      so I tried without it, and the page was shown, but with no editbar - I saw the
      ugly green column (the whole column where I was supposed to show my paragraph
      became green)

      I watched API for Edit and Editbutton classes: the
      setContainerName(java.lang.String name) method is Deprecated. - Does it mean
      that I can't use the contentNodeCollectionName attribute?

      The second bug I found while I was trying to output the contents of my node.
      I've done the following:

      <cms:set contentNode="<%=myNode%>"/> - set my node to GlobalContentNode
      <cms:includeTemplate path="/template.jsp"/> - output my node with template

      Bingo! it worked! I see my only node contents on the screen!
      But the strange thing - The image is wrong! (The image is from the other paragraph)

      What's happening?
      I opened the template.jsp and came across cmsu:fileSrc tag. - it creates the
      path for the image, and it doesn't check which node is currently "set" and the
      attribute contentNodeName also dump my page to blank.

      I had to create additional method in my template that checks if the only one
      node should be printed and makes the proper path to the image. Now it's working ok

      So, I'd like to know why the attributes mentioned above cause the page crash?

      And sorry if this letter is long and not clear.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              wyser Vinzenz Wyser
              kraft Boris Kraft
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD