SaaS CMS has officially launched! Learn more now.

Getting url to content outside of startpage

Vote:
 

We have a single site but to keep the structure clean we put some content outside of the regular startpage structure, we call it Global Content. The content is mostly just settings and "data pages" containing data that is used enrich the regular content on the page, like Tag Pages concept that Allan is talking about here: https://www.codeart.dk/blog/2018/10/design-pattern-tag-pages-instead-of-categories/

In some cases we would like to load a partial view of some of content laying here. We can navigate to that just as usual content, eg. /content/outside/startpage, but when programmatically trying to get the url for that content with either Geta EpiExtensions GetFriendlyUrl or using the UrlResolver directly just gives us null.

Is there something special needed to be able to get the url programmatically?  

#203720
May 03, 2019 16:38
Vote:
 

Do you need to use IContentLoader to Get the node as IContentData?

#203845
May 08, 2019 16:04
Vote:
 

Hi Tobias,

If your content types of the content in question have controllers then you should be able to access the content via episerver's standard routing and should be able to use the methods you mentioned above to retrieve the url. If not, you'd need to use an alternative mechanism such as partial routing to route to the content in which case it's more complex.

Are you using standard routing or partial routing (or something else) to access the content?

#203860
May 08, 2019 20:59
Vote:
 

Ah of course. I mixed it up a bit when trying to set the correct address to the page. The page has a controller but when setting this up I was referring to the parent of these pages which is a ContainerPage which has no Controller or view. 

#203990
May 15, 2019 15:05
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.