Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » Include SubNavigastion.ss

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1909 Views
  • gonace
    Avatar
    Community Member
    11 Posts

    Include SubNavigastion.ss Link to this post

    I've made a SubNavigation.ss in my theme templates folder that looks like this

    <% include LanguageChooser %>
    <% if Menu(2) %>
    <subnav>
       <div id="sub-navigation">
          <ul class="sub-navigation">
          <% control Menu(2) %>   
                 <li <% if FirstLast %>class="$FirstLast"<% end_if %>><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
          <% end_control %>
          </ul>
       </div>
    </subnav>
    <% end_if %>

    And im trying to include this on Page.ss(<% include SubNavigation %>) but I'm getting a strange error:
    [Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty

    Why?

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: Include SubNavigastion.ss Link to this post

    in what folder is SubNavigation.ss ?

  • gonace
    Avatar
    Community Member
    11 Posts

    Re: Include SubNavigastion.ss Link to this post

    /themes/THEMENAME/templates/Includes

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: Include SubNavigastion.ss Link to this post

    hmmm, thats the right place, did you put ?flush=1 in the url when viewing the page after changing it?

  • ampedup
    Avatar
    Community Member
    133 Posts

    Re: Include SubNavigastion.ss Link to this post

    Just to point out, you have a <subnav> tag in your html. This tag doesn't exist in html, and you probably shouldn't put it in.

  • gonace
    Avatar
    Community Member
    11 Posts

    Re: Include SubNavigastion.ss Link to this post

    bartvanirsel: It wokred after i restarted Apache!

    ampedup: Thats correct I've changed it to <nav>

  • ampedup
    Avatar
    Community Member
    133 Posts

    Re: Include SubNavigastion.ss Link to this post

    But <nav> isn't a html tag either. You shouldn't have that. I don't think you need this tag here at all.

    I'm curious as to why you have the <nav> or <subnav> tag?

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: Include SubNavigastion.ss Link to this post

    yes nav and subnav both don't exist, didnt even see it

    maybe apache restart cleared your /tmp dir and caused this to work,
    on what OS are you running SS?

    1909 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.