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.

Template Questions

controller for m:n - and a connected further Table


Reply

3 Posts   1052 Views

Avatar
lx

12 April 2009 at 4:42am Community Member, 83 Posts

Hi, i am new to SS. So this might be a noob question.
I want a Sidebar on almost every Page. In this Sidebar i want some Download-Links to Files.
So i made a m:n - relation for Page:Downloads (names "SidebarDownloads"). Downloads is a dataObjectclass with a has-one-Relation to FILE.
This does work in CMS.

The Problem is the Template.
If i make a controller <% control SidebarDownloads %> i can access all Data from Table Downloads, beloging to this Page.
But the actual Filename is in class "File". How can i make a link in the Template?

Sorry for my bad english.

Avatar
simon_w

16 April 2009 at 2:11pm Forum Moderator, 474 Posts

<% control SidebarDownloads %>$FileName.Link<% end_control %> should do it, where FileName is the name of the has_one to a File in the Downloads DataObject

Avatar
lx

16 April 2009 at 8:38pm Community Member, 83 Posts

thanks. Thats it. Shame on me.