API Questions on Kentico API.
Version 6.x > API > Using CMSListMenu outside CMS Project View modes: 
User avatar
Member
Member
nrussell - 4/16/2012 1:17:22 PM
   
Using CMSListMenu outside CMS Project
Hi,

Using the information from the doc:
http://devnet.kentico.com/docs/6_0/devguide/index.html?using_api_and_cms_controls_outside_cms_project.htm
I was able to add a CMSListControl to a project outside our CMS and have the control display our menu. The problem I am running into it that the links are not resolving correctly.
ie. They are resolving to http://cmshost/pagename instead of http://cmshost/context/pagename

The doc shows how to use a transform to fix the url's for displaying a news item using cms repeater but it doesn't seem to apply for the cmslistmenu. Is there anyway to change how the base url is resolved for the cmslistmenu?

Thanks,
Neil

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 4/20/2012 3:43:16 AM
   
RE:Using CMSListMenu outside CMS Project
Hi,

The construction of the menu structure cannot be controlled by a transformation from outside, so the rendered links depend on the context (the virtual path), where this menu control is used. Placing it into the correct path can change the links, but it's certainly not very flexible.

Another option would be to modify the code of the standard web part and change the paths (e.g. by a string replace operation) in the RenderedHTML property, that is accessible in the inner control used in the web part.

Regards,
Zdenek

User avatar
Member
Member
nrussell - 4/24/2012 12:23:56 PM
   
RE:Using CMSListMenu outside CMS Project
Ok, I was hoping there was a property I could set on a Kentico Context object to override the default virtual path.
I have it working now with a string replace on the RenderedHTML property.

Thanks,
Neil