ASPX templates
Version 6.x > ASPX templates > best approach to add a link to a document in CMS.Event document type View modes: 
User avatar
Member
Member
whiplash - 9/26/2012 10:14:10 AM
   
best approach to add a link to a document in CMS.Event document type
Hey Guys

What would be the best approach to add a new link to a CMS.Event document type?

To work similar to a document selector, so in my transformation I would pull out the field from the DB and have a repeater display all content ...

Regards

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/27/2012 4:17:12 AM
   
RE:best approach to add a link to a document in CMS.Event document type
Hello,

I'm a little bit confused but if I get it right, try the following:

Login to CMSSiteManager -> Development -> Document types -> Event (edit) -> Fields -> Add new attribute (green plus icon) ... in the Form control type select Selector and in the Form control select Document Selector.

You can also take a look at the DevGuide: Document type properties - section Fields tab.

Is this what you want?

Best regards,
Martin Danko

User avatar
Member
Member
whiplash - 9/27/2012 7:53:54 AM
   
RE:best approach to add a link to a document in CMS.Event document type
Hi Martin

Thanks for replying ...

I have that set up, but I'm not sure exactly how to pull that document GUID out and apply it to a link .. which when clicked will navigate the user to the document.

<%# IfEmpty(Eval("EventFindOutMoreLink"), "", "<a href="+ GetDocumentUrl("EventFindOutMoreLink") +">" + Eval("EventFindOutMoreLinkText") + " »</a>") %></p>

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/1/2012 3:19:09 AM
   
RE:best approach to add a link to a document in CMS.Event document type
Hi,

I would recommend you using the Repeater with the Tranformation like this:
<a href="<%# GetDocumentUrl() %>">
<%# Eval("EventTitle") %></a>

Best regards,
Martin Danko