Jump to:

1855 Posts in 1609 Topics by 562 members

Blog Module

SilverStripe Forums » Blog Module » Latest blogs\news\articles

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 908 Views
  • Rcls
    Avatar
    Community Member
    2 Posts

    Latest blogs\news\articles Link to this post

    I didn't get any replies during a period of one week in the other section so I might as well ask here since the News and Blogs are basically the same code.

    I'm not the most skilled coder, but I created a website for a client. I wanted to test out SilverStripe and though it has some annoying little things, like having to upload files on the FTP to get pages or styles to update, or flushing cache every 5 minutes, it works great.

    I downloaded and installed an extension named News. Basically it's the same NewsHolder (ArticleHolder) and NewsPage (ArticlePage) to what is in the tutorials but without having to create the files yourself. It works great, you can view results here: http://www.ossipesonen.fi/www/ss_cms/uutiset/
    But I have a problem. I can't get the "Tiedotteet" or Latest News to show on every page. It only shows on the News page. How can I change this? Latests News is like Latests Blogs but even in the tutorials it only works on HomePage. Do I need to change to a different CMS to get this working?

    Page.ss

    <% include Menu2 %>

    Menu2.ss

    <% control Menu(2) %>
    <% if Children %>
    <li><p style="padding-top: 10px;"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode levela">$MenuTitle.XML</a></p>
    <% else %>
    <li><p style="padding-top: 10px;"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode levela">$MenuTitle.XML</a></p>
    <% end_if %>
    </li>
    <% end_control %>

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Latest blogs\news\articles Link to this post

    Latests News is like Latests Blogs but even in the tutorials it only works on HomePage.

    This is because the PHP function is stored in the HomePage class (HomePage.php). No other page types "know" about functionality contained in other classes. If you want the same LatestNews() function available on all pages you should put the PHP function that is in HomePage.php (LatestNews()) in Page.php instead. All pages on your site should extend off Page so they will all inherit this functionality.

    908 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.