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?

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
FatTony1952
View Replies:

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.