No Data Being Pulled

Mansur Syed's Avatar

Mansur Syed

20 Feb, 2014 07:07 PM

I'm trying to format some user entered data (from a data def) with velocity using this script for the particular block, but on render I can't seem to get anything to show up. I've also attached a file with a XML path hierarchy to give a clearer idea of what I'm trying to target.


#set ($accordions = $_XPathTool.selectNodes($contentRoot, '//accordion'))

#foreach ($accordion in $accordions)
#set ($header = $_EscapeTool.xml($accordion.getChild('accd-header').text))
    <p class="expander-header">$header</p>
#set ($content = $_EscapeTool.xml($accordion.getChild('accd-content').text))
    <div class="expander-content">
        $content
    </div>
#end
  1. 1 Posted by Ryan Griffith on 21 Feb, 2014 02:29 PM

    Ryan Griffith's Avatar

    Hi Mansur,

    Looking over the Format and screenshot, everything seems to be correct. I have a few additional questions to see if we can narrow things down a bit:

    • How is the block being included? Is it attached directly to a page region or using a block chooser?
    • If you are using a block chooser, have you tried increasing the Render Content Depth option for the chooser? I generally use 5 to be on the safe side.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Mansur Syed on 24 Feb, 2014 06:50 PM

    Mansur Syed's Avatar

    Hey Ryan,

    I'm applying the format directly to this page region as shown below. Any thoughts?

    -Manzi

  3. 3 Posted by Ryan Griffith on 24 Feb, 2014 08:34 PM

    Ryan Griffith's Avatar

    Hi Mansur,

    Thank you for providing a screenshot of your current setup.

    It looks like you do not have an Index Block applied to the region, because of this your Format does not have access to the Page's structure data. When you have a moment, try selecting a "current/calling page" Index Block to the region and let me know if the output changes. For more information about setting up this type of Index Block, please see this page (under the FAQs section).

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by Ryan Griffith on 03 Mar, 2014 01:05 PM

    Ryan Griffith's Avatar

    Hi Mansur,

    Just wanted to follow up to see if you had a chance to view my recent comment.

    Please let us know if you have any questions.

    Thanks!

  5. 5 Posted by Mansur A. Syed on 03 Mar, 2014 05:47 PM

    Mansur A. Syed's Avatar

    Actually your comment did help! Thank you! I came across a different and separate problem though so I’ve been trying to address that.

     

    Can I ask why the current/calling page index block is required? How does it technically work?

  6. 6 Posted by Ryan Griffith on 03 Mar, 2014 07:34 PM

    Ryan Griffith's Avatar

    Thank you for following up, Mansur. I am glad to hear that helped out.

    Can I ask why the current/calling page index block is required? How does it technically work?

    Generally, a Block should accompany any Format within a page region so the Format has access to the appropriate XML data you would like to transform. In this case, a current/calling page Index Block is required in order to give your Format access to the XML data (ie metadata and structured data) of the current page.

    The only cases where you would not need an Index Block:

    • You are using the Locator Tool to access the current/calling Page's data
    • Your Velocity Format does not need access to any dynamic content. Note: stand-alone (Block-less) Formats are only possible with Velocity.
    • You are dealing with the DEFAULT region, which by default will include the structure data of the current/calling page

    Please let me know if you have any questions.

    Thanks!

  7. Ryan Griffith closed this discussion on 07 Mar, 2014 02:09 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM