Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Basic CMS Customization Question


Reply

2 Posts   1069 Views

Avatar
tbarho

22 January 2010 at 11:05am Community Member, 41 Posts

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
Avatar
CodeGuerrilla

22 January 2010 at 7:23pm Community Member, 105 Posts

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