Skip to content

A concrete5.7 attribute type that allows the selection of pages

Notifications You must be signed in to change notification settings

Mesuva/multi_page_selector_attribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Multi Page Selector Attribute

A multiple page selector attribute for concrete5 version 5.7.

  • Allow multiple pages to be selected from the sitemap
  • Sitemap can be filtered by section and/or by page type
  • Can also be restricted to allow the selection of one page only

Once installed, you can fetch the attribute in a page template one of two ways:

$products = $c->getAttribute('related_products');
// $products now contains an array of collection (page) objects

// or 
$products = $c->getAttribute('related_products', 'pageLinkArray');
// $products now contains an array of arrays, each containing 'cID' 'url', 'name', and 'obj' (the original page object) meaning you can do:

if (!empty($products)) { 
    echo '<ul>';
    foreach($products as $prod) {
        echo '<li><a href="' . $prod['url'] . '">'. $prod['name']. '</a></li>';
    }
    echo '</ul>';
}

For reference, the original string with comma seperated ID values can be retrived via:
$productsIDsList = $c->getAttribute('related_products', 'raw');

About

A concrete5.7 attribute type that allows the selection of pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages