How to Use Include Files in Templates – SilverStripe CMS

One of the thing you want to use as an included template files is mostly 2nd level menu (sidebar menu).

Include files must be in themes/yourtemplatename/templates/Includes folder it’s the same level as Layout folder.

2nd level menu example code u add to themes/yourtemplatename/templates/Includes/

<% if Menu(2) %>
    <ul id="Menu2">
        <% control Menu(2) %>
            <li class="$LinkingMode"><a href="$Link" title="Go to the $Title page">$MenuTitle</a></li>
        <% end_control %>
<% end_if %>

And to include the use in your themes/yourtemplatename/templates/Layout/ code:

<% include Menu2 %>

Looking for quality SilverStripe Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , | Posted under SilverStripe CMS | RSS 2.0

Author Spotlight

Teet Bergmann

I'm a freelance web designer from Estonia. Mostly doing sites using Silverstripe, magento, prestashop, wordpress.

Leave a Reply

Your email address will not be published. Required fields are marked *