Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Selected Item Transformation From Different Site View modes: 
User avatar
Member
Member
Darren - 5/24/2010 6:00:08 AM
   
Selected Item Transformation From Different Site
Hi all,

I'm trying to display a list of news items from a seperate site within Kentico. I can display the documents fine but I am having difficulty displaying the selected document when the link is clicked.

When I use <%# GetDocumentUrl() %> it seems to get stuck in an endless loop. I can hard code the URL of the other site before the <%# GetDocumentUrl() %> in the transformation which works, but that obviously re-directs to the other site which is not what I really want. I want to keep the user on the same site if possible.

Ideally I want to use something like <%# GetUrl("/News/News-1", null, "CorporateSite") %> which is normally for a specific file, but I want to use it for each seperate item displayed in my repeater.

Any help is greatly appreciated. Cheers.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/25/2010 6:12:26 AM
   
RE:Selected Item Transformation From Different Site
Hello,


Regrettably, it is not possible to display the content without redirection.

You could use linked documents which display the copy of document from different site on your site. Then it would not redirect the user. Please see here: http://devnet.kentico.com/docs/devguide/creating_a_linked_document.htm for more information about linked documents.

Otherwise, you could use the full URL for documents from a different site but it would redirect the user.

You would develop a custom transformation function which can have one argument - <%# GetDocumentUrl() %>. It can use the API method which gets the full URL from relative URL inside the transformation function:

CMS.GlobalHelper.UrlHelper.GetAbsoluteUrl(String RelativeURL)

So it can return the full URL from the current relative path which you can get by <%# GetDocumentUrl() %>.

Please see here: http://devnet.kentico.com/docs/devguide/adding_custom_functions_to_transformations.htm for more information about custom transformation functions.

The API Reference is here: devnet.kentico.com/downloads/kenticocms_api.zip



Best regards,
Helena Grulichova