PageList and "select Attribute" - how to get selected value?
PermalinkNow I want to print inside the view.php of [page list] block - the name of the "selected" option (one or more)
Example: Page list like this (each page list item - echo the subject)
http://noeeko.com/category/projects/illustration/...
*** I remember i saw in the past Tut about this in C5 docs. If someone know this please add link
I saw her for example more complicated code. And dont understand the problem
https://gist.github.com/hissy/6255509...
(the echo - give me "1. seo mobile")
$attributeOptions = $page->getCollectionAttributeValue('attribute_handle'); foreach($attributeOptions as $option){ echo $option->value; }
Just wondering if you would be willing to share how you managed this. I would love to be able to create a filterable page list but I have had a look and simply dont have the skills to do it?
I have one on 5.6 and am upgrading a site and am stuck as how to get that functionality
Thanks
http://isotope.metafizzy.co/
http://mixitup.kunkalabs.com/
http://getuikit.com/docs/grid-js.html...
Sorry, Its impossible to explain how to do this in forum post (long topic). Try use google/youtube to find "how to" or tut about "custom template" & js + download some addons that use js (galleries, dropdowns navs ect.) and try to learn this issue.
I send you by email Example.
if ( !is_null($page->getCollectionAttributeValue('attr_nm')) && !is_null($page->getCollectionAttributeValue('attr_nm')->getSelectedOptions()) && !is_null($page->getCollectionAttributeValue('attr_nm')->getSelectedOptions()->getValues()) ) { $values = ( array_map( function ($row) { return $row->getSelectAttributeOptionValue(); }, $page->getCollectionAttributeValue('attr_nm')->getSelectedOptions()->getValues() ) ); }
To get the value of a select attribute within the PageList Custom Template you would do something like this