Documentation 2.x

Global sidebar

Read this if you want your sidebar to be the same in all pages.

Why it is so complicated?

This is a temporary way of doing that while ImpressPages CMS does not support static / global blocks natively.

What are the steps?

1. Create new zone with name 'static'. Read here how to create new zone.

2. Add one page to that zone in Menu Management. Press right mouse on it, 'edit' and add some content to the sidebar.

3. Open ip_themes/lt_pagan/main.php and replace the line: $site->generateBlock('side'); with this code:

<?php
    $staticZoneName = 'static';
    if ($site->getCurrentZone()->getName() == $staticZoneName || !$site->managementState()) {
        //print block without administration tools
        $hiddenZoneElements = $site->getZone($staticZoneName)->getElements();
        $firstElement = reset($hiddenZoneElements);
        if ($firstElement) {
            $publishedRevision = \Ip\Revision::getPublishedRevision($staticZoneName, $firstElement->getId());
            echo \Modules\standard\content_management\Model::generateBlock('side', $publishedRevision['revisionId'], $site->managementState());
        }
    }
?>

That's all. To edit sidebar, go  to that one created page and edit (don't forget to publish your changes). Published changes will immediately appear on all pages on the website.

Please note that the sidebar will be invisible in administration mode.

Write a comment

You must be logged in to comment.