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

Issues with subtemplate


Go to End


2 Posts   988 Views

Avatar
fireballmatt

Community Member, 2 Posts

23 August 2011 at 7:49am

I'm following the first tutorial, just trying to get familiar with how SilverStripe does things.

I've created the Layout directory, modified Page.ss to point to it with $Layout in the proper place.

the HomePage.ss within the Layout directory seems to work just fine, everything is included.

The Page.ss within the Layout directory however only appears to display the HTML and $Content.

If I try to add as something as simple as:

<% if Level(2) %>
        this is a test!
<% end_if %>

It will display the HTML and whatever is in $Content, but nothing from within that if block when I attempt to browse to a page using the Page.ss template.

Avatar
martimiz

Forum Moderator, 1391 Posts

28 August 2011 at 9:58pm

Hi

A bit of a late reply, but still:

- Did you do a ?flush=1 after adding the new Page.ss template to activate it?
- Also I suppose the page you're browsing is part of a section consisting of at least a rootpage with some childpages?