xml formatting issue
I have the following data definition:
<system-data-structure>
<asset type="page" identifier="redirectpage" label="Redirect Page"/>
<asset type="file" identifier="redirectfile" label="Redirect File"/>
<text type="checkbox" identifier="openinnewwindow" label="Open in new
window?">
<checkbox-item value="Yes"/>
</text>
</system-data-structure>
The following format:
#set ($page = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/calling-page/system-page"))
#set ($data = $page.getChild("system-data-structure"))
#set ($redirect_page_url = $_XPathTool.selectSingleNode($data, "redirectpage").getChild("link").value)
#set ($redirect_file_url = $_XPathTool.selectSingleNode($data, "redirectfile").getChild("link").value)
#set ($open_in_new_window = $_XPathTool.selectSingleNode($data, "openinnewwindow").value)
#if($redirect_page_url.length() > 2)
#set ($redirect_url = $redirect_page_url)
#elseif ($redirect_file_url.length() > 2)
#set ($redirect_url = $redirect_file_url)
#end
#if($open_in_new_window == "Yes")
<meta http-equiv='Refresh' content='0;URL=[system-asset]${redirect_url}[/system-asset]' target='_blank' />
#else
<meta http-equiv='Refresh' content='0;URL=[system-asset]${redirect_url}[/system-asset]' />
#end
Whether I check the checkbox or not I always get the else
option. What am
I missing?
Thanks
Bill
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
1 Posted by Ryan Griffith on 16 Jul, 2015 11:36 AM
Hi Bill,
If you take a look at the XML that is generated by that Data Definition, you will notice there is an additional
<value>
element that holds the value of the checkbox.When you have a moment, try adjusting the line that sets
$open_in_new_window
to the following:Please let me know if you have any questions.
Thanks!
2 Posted by William White on 17 Jul, 2015 03:14 AM
Ryan,
Thanks. I accidentally deleted the value you pointed out. It didn't
completely resolve the problem but I did get it resolved.
Thanks for your help!
Bill
3 Posted by Ryan Griffith on 17 Jul, 2015 12:07 PM
Thank you for following up, Bill, I am glad to hear you were able to resolve the issue.
I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.
Have a great day!
Ryan Griffith closed this discussion on 17 Jul, 2015 12:07 PM.