updating a dynamic meta data set to be checkboxes
On our news site we have a Dynamic Metadata field that allows a user to type out categories which allows our Releases and Announcements to be filtered. The problem I see is that these have to be manually added which can allow inconsistencies and errors. I think it'd be easier to just have checkboxes in place so it's consistent and easier.
I attached what our current Metadata and the one I just created. You can see the fucntionality in action on this page.
I'm pretty sure the format that controls this is on this page and this is the line:
<div class="listcont">
<h3><a href="{path}"><xsl:value-of select="title"/></a></h3>
<p><xsl:value-of select="hh:convertDate(number(created-on))"/></p>
<xsl:copy-of select="description/node()"/>
<div class="cats"><xsl:text>Categories: </xsl:text><xsl:value-of select="dynamic-metadata[name='tags']/value"/></div>
<div class="checkcats" style="display:none;"><xsl:call-template name="cleanWords"><xsl:with-param name="keywords" select="dynamic-metadata[name='tags']/value"/></xsl:call-template></div>
</div>
Is there a way to update this format so that it can take the values of the checkboxes so users don't have to type out categories every time?
-
Original_Category.png 46.6 KB
-
Checkbox_Category.png 68.5 KB
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 09 Mar, 2015 02:18 PM
Hi Matthew,
Instead of outputting a single string like the following:
You would want to loop over the checkbox items using an
xsl:for-each
orxsl:apply-templates
tag:OR:
Note: I used
<xsl:template match="value" mode="tag">
here because the name of match of the template is generic and could potentially be used on other elements. Adding themode
attribute means the template will only be called when you specify the mode in the apply tag, like in the example above.Please let me know if you have any questions.
Thanks!
2 Posted by matthew.wren on 10 Mar, 2015 07:25 PM
I think this did the trick. Thanks again!
3 Posted by Ryan Griffith on 10 Mar, 2015 07:34 PM
Not a problem at all, Matthew, thank you for following up.
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 10 Mar, 2015 07:34 PM.