Jump to:

22977 Posts in 11747 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Can silverstripe work on an article model?

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: 974 Views
  • samadeus
    Avatar
    Community Member
    27 Posts

    Can silverstripe work on an article model? Link to this post

    My site requires one page to be on a article model, meaning that that page will show items in a row in one page . can that be achieved here?

    Many thanks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Can silverstripe work on an article model? Link to this post

    Are the articles their own pages? Just create an ArcicleHolder page type and an Article page type.

    class ArticleHolder extends Page
    {
    static $allowed_children = array ('Arcicle');
    }

    and on your template:

    <ul>
    <% control Children %>
    <li><a href="$Link" title="Go to the $Title article">$Title</a></li>
    <% end_control %>
    </ul>

  • samadeus
    Avatar
    Community Member
    27 Posts

    Re: Can silverstripe work on an article model? Link to this post

    UncleCheese,

    Thanks for your replay.

    Yes, the articles will be each in another page, but i want them to be shown in head page of the category, and like it is right now that each page is shown on the side bar.

    I don't have much aknowledg in programing, so can you be kind and tell me how it's been done? should i paste your code on a notepad and upload it the root folder? and about the template code, on what page exactly should i paste this?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Can silverstripe work on an article model? Link to this post

    Hi samadeus

    I would reccomend doing the tutorials, they give you a great introduction to Silverstripe and also happen to contain the instructions for what you want to do

  • samadeus
    Avatar
    Community Member
    27 Posts

    Re: Can silverstripe work on an article model? Link to this post

    Hi aram

    I did went through the tutorials and i couldn't find any thing that describes for newbies like me how to do that. maybe i have missed that paragraph, could you point to it maybe?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Can silverstripe work on an article model? Link to this post

    Tutorial 2 goes through the process of making an article section with ArticleHolder to show all the articles in that section. It also shows how to create a 'latest articles' section on the home page.

    http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site

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