Structure Documentation

  • Download and install Freebie https://addons.reinos.nl/freebie
  • Read the Freebie docs for an understanding of its tags: https://docs.reinos.nl/freebie/
  • Enable the Freebie extension under Add-Ons » Extensions
  • Configure Freebie under Add-Ons » Extensions » Freebie » Settings
  • Freebie segments: add your category trigger (this can be anything and does not need to match your EE category trigger setting, you'll set it below in the template code)
  • Breaking segments: add the same word as the above setting
  • Break on category URL indicator: this setting does not matter because we're not using normal category URLs
  • Create a new template for your new page and listing. We'll use segment conditionals to determine if it's a full listing, category listing or detail page.
  • Optionally, you can use a different template for detail pages if desired by using the setting under Structure » Channel Settings for your listing. This example uses the same template for both the main page holding the listing and the listing detail entry.

Linking To Your Categories

This example shows a category listing 2 levels deep within a hierarchy, so the segments and links need to be adjusted to fit where your listing lives. The example listing lives at the second segment for example purposes.

  
    <ul>
        <li><a href="/index.php/{segment_1}/{segment_2}/category/category-name-1">Category 1</a></li>
        <li><a href="/index.php/{segment_1}/{segment_2}/category/category-name-2">Category 2</a></li>
    </ul>
 
 

Calling Entries In Your Templates

We'll use segment conditionals to see if Freebie segments exist, which our extension settings are telling EE to ignore:

  
    {!--- /////////////////////// FULL LISTING (ALL ENTRIES) /////////////////////// --}
    {if "{freebie_3}" == ""}
    <h3>Page Name</h3>
    <ul>
        {exp:channel:entries channel="listing-channel-name" dynamic="no"}
        <li><a href="{page_url}">{title}</a></li>
        {/exp:channel:entries}
    </ul>
    {!--- /////////////////////// CATEGORY ENTRIES /////////////////////// --}
    {if:elseif "{freebie_3}" == "category"}
    <h3>Category: {freebie_4}</h3>
    <ul>
        {exp:channel:entries channel="listing-channel-name" category="{exp:freebie:category_id segment='4'}" dynamic="no" parse="inward"}
        <li><a href="{page_url}">{title}</a></li>
        {/exp:channel:entries}
    </ul>
    {!--- /////////////////////// DETAIL PAGE /////////////////////// --}
    {if:else}
    {exp:channel:entries}
    <h2>{title}</h2>
    {custom-field}
    {/exp:channel:entries}
    {/if}
 
 

Support

Having problems setting up and/or using Structure? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.