Development

Filtering queries based on structured data values

Using the querytool, you may have a need to filter based on pages that have a specific checkbox, dropdown, multi-select, or radio option selected. Rather than using something like the following:

$_.query().bySiteName("CascadeUniversity").byContentType("Page Types/News").hasStructuredData("details/is-featured", "Yes").execute()

You will instead need to iterate over the results of your query and utilize a conditional statement to get the desired results. For example:

#set ($list = $_.query().bySiteName("CascadeUniversity").byContentType("Page Types/News").execute())
#foreach ($page in $list)
#if ($page.getStructuredData("details/is-featured").hasTextValue("Yes"))
...your code here...
#end
#end