Pages Showing onto site

hello there,

Any one with the idea how to display links of pages created in the admin panel onto the footer or header menu bar?

desperate, help.

thanks

Comments

  • edited September 2015
    Use this:

    <?php

    $query = "SELECT page_id FROM " . DB_PREFIX . "pages WHERE status = 'published'";
    $resultPages = $db->fetchAll ($query, array());

    $pageList = $pageMapper->getPagesFromList(
    Functions::arrayColumn($resultPages, 'page_id')
    );

    ?>

    <?php foreach ($pageList as $page): ?>
    <p><a href="<?=HOST?>/<?=$page->slug?>/"><?=$page->title?></a></p>
    <?php endforeach; ?>
  • Thanks bro. One more thing, which file in my control panel do i go to inorder to insert this code.?
  • Which header/footer are you trying to display these links at? The ones for the main site or the ones for the admin panel?
  • i want to display them in footer for main site not admin.
  • Got it. So that means you add the code I provided above to the file:

    /cc-content/themes/{YOUR_THEME}/blocks/footer.phtml

    Make sure you create a custom theme so that your theme changes aren't lost during updates. See here if you're not sure how to do so:

    http://cumulusclips.org/forums/index.php?p=/discussion/300/how-to-create-a-custom-theme-by-copying-the-default-theme
This discussion has been closed.