Skip the setup. Our team will have you taking orders in 24 hours. Get started →
Version notice: This documentation is for version 3, but the latest available version is version 4.
Extensions

Pages Extension

Introduction Installation Admin Panel Usage #Introduction This TastyIgniter extension allows end users to manage static pages and menus with a simple WYSIW...

This TastyIgniter extension allows end users to manage static pages and menus with a simple WYSIWYG user interface.

This extension includes two components: Static Page and Static Menu.

To install this extension, click on the Add to Site button on the TastyIgniter marketplace item page or search for Igniter.Pages in Admin System > Updates > Browse Extensions

In the admin user interface you can create, edit or delete pages and menus.

The first thing we have to do is create the layout that will host all pages of the website.


---

description: Static layout for static pages

'[staticPage]':

'[staticMenu]':
    code: main-menu

---

<html>
    <head>
        <title>{{ $this->page->title }}</title>
    </head>
    <body>
        @component('staticMenu')
        {!! page() !!}
    </body>
</html>

Includes the staticPage and staticMenu component to the layout. The staticMenu component has the code property that should correspond to a code of the static menu to display.

The static menu component injects the menuItems page variable. The menuItems variable is an array of objects. Each object has the following properties:

  • title - specifies the menu item title.
  • url - specifies the absolute menu item URL.
  • isActive - indicates whether the item corresponds to a page currently being viewed.
  • isChildActive - indicates whether the item contains an active subitem.
  • extraAttributes - specifies the menu item extra HTML attributes
  • items - an array of the menu item subitems, if any. If there are no subitems, the array is empty
@foreach ($menuItems as $item)
   <li><a href="{{ $item->url }}">{{ $item->title }}</a></li>
@endforeach

Setting the active menu item explicitly

You may want to tag a particular menu item explicitly as active in some cases. You can do that in the onInit() function of the page, by assigning a value to the activeMenuItem page variable matching the menu item code that you want to activate. In the Edit Menu Item popup, menu item codes are managed.

function onInit()
{
    $this['activeMenuItem'] = 'about-us';
}	

Did this answer your question?

Your feedback helps us improve our help articles.

Need more help?

Explore the help center, join the community, or get priority support from the TastyIgniter team.