Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Basic CMS Customization Question

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

Page: 1
Go to End
Author Topic: 1015 Views
  • tbarho
    Avatar
    Community Member
    41 Posts

    Basic CMS Customization Question Link to this post

    Hi all,

    I've been trying to get this working to no avail, but basically what I'm wanting to do is this:

    This is the basic data-model surrounding my question

    class Ticket extends DataObject {
    static $has_many = array(
          'Messages' => 'Message'
       );
    }

    I'm trying to figure out how to get a custom CMS page working that allows me to see a list of Tickets, then click on a ticket, and in TicketAdmin_right.ss, show the Messages for that ticket, along with a form to add a new message.

    What I have so far is TicketAdmin.php, TicketAdmin_left and _right template files, and a method for Show in my controller that allows for /admin/ticket/show/$ID (and just returns the ID).

    In my TicketAdmin_right.ss template, I have the code for the list of tickets. Something like:

    <% if Tickets %>
       <ul>
          <% control Tickets %>
             <li><a href="admin/ticket/show/$ID">$Subject</a></li>
          <% end_control %>
       </ul>
    <% end_if %>

    When I go that URL though, it doesn't render in my TicketAdmin_right template, it just renders on a blank page. What template do I need to create to have it show up in the nicely formatted _right.ss template? I'm trying to accomplish something similar to the attached image when I click on a particular ticket

    Attached Files
  • CodeGuerrilla
    Avatar
    Community Member
    105 Posts

    Re: Basic CMS Customization Question Link to this post

    You might able to use ModelAdmin it isn't very easy to create CMS modules from my experience

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