Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Show limit object on Page

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

Page: 1
Go to End
Author Topic: 280 Views
  • bubu333
    Community Member
    8 Posts

    Show limit object on Page Link to this post

    I have a HolderPage.php and I create children page for HolderPage.php(ProjectPage.php)
    When i show on template i write:
    <% control Children %>

    <% end_control %>

    And i create ImageObject.php:
    static $has_one=array('ProjectPage'=>'ProjectPage');
    ProjectPage.php:static $has_many=array('ImageObjects'=>'ImageObject');
    I show imageobject.php on template
    <% control Children %>
    <% control ImageObjects %>
    <% end_control %>
    <% end_control %>

    It work fine but i want to show 3 image on template,If user create 5 image i just want to show 3.
    And i don't know where i can write function that...I tried to write it in HolderPage_Controller,ProjectPage_Controlller...It not work.Help me!

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.