Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Different page types under ArticleHolder Page type

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 639 Views
  • Anaya
    Avatar
    Community Member
    42 Posts

    Different page types under ArticleHolder Page type Link to this post

    Hi Guys,

    I am trying to add Page, Calendar and ArticlePage page types under ArticleHolder page type.
    But dont want ArticlePages in my left navigation...

    1. Following is the code used in ArticleHolder.php =>
    class ArticleHolder extends Page {
    static $db = array(
    );
    static $has_one = array(
    );

    static $allowed_children = array("Page", "Calendar");
    }

    2. To add articles on ArticleHolder page - following code is used in ArticleHolder.ss =>

    <% control Articles %>
       <div id="NewsListL">
       $Photo.SetWidth(85)
       </div>
       <div id="NewsListR">
    <a href="$Link" title="Read more on &quot;{$Title}&quot;" class="title">$Title</a><br/>
    <span class="newsDate">$Date.Nice</span><br/>
    $Content.FirstParagraph <a href="$Link" title="Read more on &quot;{$Title}&quot;">Read more &gt;&gt;</a>
       </div>
       <div class="clear"></div>
       <% end_control %>

    3. And in Page.php - I am using following code =>

    function Articles() {
    return DataObject::get('ArticlePage');
    }

    4. Code in Sidebar.ss =>

    <% control Menu(2) %>
    <% if Children %>
    <li>
    <a href="$Link" title="$Title" class="$LinkingMode">$MenuTitle<span class="greenArrow">&raquo;</span></a>
    <% if LinkOrSection = section %>
       <ul id="SidebarMenu1">
          <% control Children %>
             
             <li><a href="$Link" title="$Title" class="$LinkingMode"><span>$MenuTitle</span></a></li>
          
          <% end_control %>
       </ul>
    <% end_if %>
    </li>
    <% else %>
    <li>
    <a href="$Link" title="$Title" class="$LinkingMode"><span>$MenuTitle</span></a>
    </li>
    <% end_if %>
    <% end_control %>

    Is there any way not to include Article pages in left navigation on ArticleHolder page or any of its sub pages????

    Kind Regards
    Anaya...

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