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.

Archive /

Our old forums are still available as a read-only archive.

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

Action which renders a template in the Sidebar


Reply


3 Posts   1444 Views

Avatar
teejay

Community Member, 63 Posts

20 August 2008 at 2:12pm

Edited: 20/08/2008 2:13pm

Hi,

I have maybe a very simple problem but I have no Idea for the moment. I have created a action in my news page controller which shall render a template in my sidebar. I just want to populate text data in the sidebar.

Any ideas how to do that ?

Regards Thomas

Avatar
yuqinz

Community Member, 1 Post

20 August 2008 at 2:51pm

Just call the $ActionName in the sidebar.ss

Avatar
teejay

Community Member, 63 Posts

20 August 2008 at 3:00pm

after another 30 minutes I have done the following and I came to the same conclusion than you

Archive.ss

<% if GetArchive %>
<div class="sidebarBox">
<h3>Sub Menu</h3>
<% control GetArchive %>
<p>$Title</p>
<% end_control %>   
</div>
<% end_if %>


this is an include file to encapsulate it a little bit.

But is it possible to render the template from the controller level. Before this SilverStripe I have done mostly everything with Zend Framework and Silverstipes architecture is completely different to the Zend approach, thats why I am often a little bit confused how to do things in Silverstripe.

But anyway Silverstripe has some nice functions :)

Regards Thomas