Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » news article pages

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 984 Views
  • widget
    Avatar
    Community Member
    19 Posts

    news article pages Link to this post

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

  • widget
    Avatar
    Community Member
    19 Posts

    Re: news article pages Link to this post

    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>

  • widget
    Avatar
    Community Member
    19 Posts

    Re: news article pages Link to this post

    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.

    984 Views
Page: 1
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.