Page list select box
Permalink Browser Info Environment
I'd been posting this on another thread, but thought I'd move it to its own.
I'm trying to pull a list of pages related to a particular parent ID to populate a dropdown list.
Would it be possible to put this into the Header Extra Content and pull in a list using the code below, then assigning a css ID to the selectbox to echo the page list?
I'm trying to pull a list of pages related to a particular parent ID to populate a dropdown list.
Would it be possible to put this into the Header Extra Content and pull in a list using the code below, then assigning a css ID to the selectbox to echo the page list?
Loader::model('page_list'); $pl = new PageList(); $pl->sortByDisplayOrder(); $pl->sortByMultiple('p1.cParentID ASC, p1.cDisplayOrder ASC'); $pagelist = $pl->get(); foreach ($pagelist as $p) { echo '. htmlspecialchars($p->getCollectionName()) . '; }
<script> $(document).ready(function() { $('.selectbox-css-ID').val('<? echo '. htmlspecialchars($p->getCollectionName()) . '; ?>'); }); </script>
Type: | Discussion |
---|---|
Status: | New |