Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Include SubNavigastion.ss


Go to End


9 Posts   3669 Views

Avatar
gonace

Community Member, 11 Posts

27 April 2010 at 9:35pm

Edited: 27/04/2010 10:06pm

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?:)

Avatar
bartvanirsel

Community Member, 96 Posts

28 April 2010 at 5:57am

in what folder is SubNavigation.ss ?

Avatar
gonace

Community Member, 11 Posts

28 April 2010 at 6:06am

/themes/THEMENAME/templates/Includes

Avatar
bartvanirsel

Community Member, 96 Posts

28 April 2010 at 6:27am

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

Avatar
3dgoo

Community Member, 135 Posts

28 April 2010 at 5:09pm

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.

Avatar
gonace

Community Member, 11 Posts

28 April 2010 at 6:11pm

bartvanirsel: It wokred after i restarted Apache!

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

Avatar
3dgoo

Community Member, 135 Posts

28 April 2010 at 8:30pm

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?

Avatar
bartvanirsel

Community Member, 96 Posts

28 April 2010 at 8:37pm

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?

Go to Top