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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Basic CMS Customization Question


Go to End


2 Posts   1712 Views

Avatar
tbarho

Community Member, 41 Posts

22 January 2010 at 11:05am

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

Community Member, 105 Posts

22 January 2010 at 7:23pm

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