check if a block chooser is empty
I'm modifying the format for our calendar to use a block chooser for the contact information. What is the best way to check if a block chooser is empty? I tried this in my script, but it displays $_SerialializerTool.serialize($contactInfo, true) if the block is empty. Is there a way to check if a node exists, instead of checking if a node is empty? I'm using the SerializerTool because in some of our contact blocks there is html (just not the sample I provided below).
`#if ($contactInfo.value != "")
- Contact:
- $_SerializerTool.serialize($contactInfo, true)
</dd>
#end`
block xml:
<contact type="block"> <content>(417)
328-6302</content>
<path>/_internal/blocks/contact-info/birth-place</path>
<site>citizensmemorial.com</site>
<name>birth-place</name> </contact>
Empty block xml:
/
This discussion was closed! See this FAQ for more information:
-
How do I include structured data content with an asset chooser?
See more..By default, asset choosers will not include structured data content for a chosen asset. In order to include this content, modify the chooser field and set the Render Content Depth field to a value of at least 2.
Note: Depending on the structure of the chosen asset, a higher value may be required.
Before
After
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
lauren.fraser closed this discussion on 09 Jan, 2014 03:13 AM.