XML feed block metadata

Joyce's Avatar

Joyce

Aug 08, 2015 @ 07:00 PM

Is it possible to get an xml feed block's metadata (e.g. display name/title) and the feedURL value with the XPathTool when applied to a system region?

  1. 1 Posted by Wing Ming Chan on Aug 09, 2015 @ 03:23 PM

    Wing Ming Chan's Avatar

    Hi Joyce,

    When a feed block is attached to a region, only the XML is visible to the region. But if you are willing to use the LocatorTool instead, then you can get what you want. Here is some code to get you started:

    #set( $path      = '/_cascade/blocks/feed/cghats' )
    #set( $site_name = 'cascade-admin' )
    #set( $block     = $_.locateBlock( $path, $site_name ) )
    <pre>
    
    
    $block.feedURL $block.metadata.summary </pre>
    Wing
  2. 2 Posted by Joyce on Aug 10, 2015 @ 01:30 PM

    Joyce's Avatar

    Ok thanks. Yes, I was using the Locator Tool to retrieve the node, just wondering if it was possible with XPath instead.

    Thanks for the confirmation!

  3. Joyce closed this discussion on Aug 10, 2015 @ 01:30 PM.

  4. Joyce re-opened this discussion on Aug 11, 2015 @ 04:26 PM

  5. 3 Posted by Joyce on Aug 11, 2015 @ 04:26 PM

    Joyce's Avatar

    Is it possible to get the feed block's dynamic metadata with the Locator tool?

  6. 4 Posted by Wing Ming Chan on Aug 11, 2015 @ 04:35 PM

    Wing Ming Chan's Avatar

    Sure. Once you get the metadata object ($block.metadata), you can call the getDynamicField(String) method to get the field object. You may need to use $_PropertyTool.outputProperties() to expose the API of the field object.

    Wing

  7. 5 Posted by Joyce on Aug 11, 2015 @ 05:16 PM

    Joyce's Avatar

    Awesome, thanks!

  8. Joyce closed this discussion on Aug 11, 2015 @ 05:27 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