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.

All other Modules /

Discuss all other Modules here.

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

news article pages


Go to End


3 Posts   1579 Views

Avatar
widget

Community Member, 19 Posts

25 June 2009 at 9:37pm

Hi i am following the turtorial for adding news and article pages. going quite well. but i have got to the template stage and need to adjust the pages and getting confused.

this is the instruction:

And then replace the second level menu with <% include Menu2 %> in Page.ss and ArticlePage.ss like so:

themes/tutorial/templates/Layout/Page.ss, themes/tutorial/templates/Layout/ArticlePage.ss

<% include Menu2 %>

<div id="Content" class="typography">
...

and this is the Page.ss

<div class="typography">
<% if Menu(2) %>
<% include SideBar %>
<div id="Content">
<% end_if %>

<% if Level(2) %>
<% include BreadCrumbs %>
<% end_if %>

<h2>$Title</h2>

$Content
$Form
$PageComments
<% if Menu(2) %>
</div>
<% end_if %>
</div>

I am just a bit confused where to apply the above instruction, can someone help me out. please. Am i adding it into the code or replacing part of the code??

Avatar
widget

Community Member, 19 Posts

25 June 2009 at 9:38pm

and then here is the ArticlePage.ss

<% 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 %>
</ul>
<% end_if %>

<div id="Content" class="typography">
<% if Level(2) %>
<div class="breadcrumbs">
$Breadcrumbs
</div>
<% end_if %>

<h1>$Title</h1>
$Content
<div class="newsDetails">
Posted on $Date.Nice by $Author
</div>
</div>

Avatar
widget

Community Member, 19 Posts

25 June 2009 at 9:48pm

and i have to add/replace this to the ArticlePage.ss too:

...
<div id="Content" class="typography">
<% include Breadcrumbs %>
...

just not sure what to change or keep in the rest of the code, i hope that all makes sense.