EPiServer 8: Navigate by template and ID

Vote:
 

Is it still possible in some way to access a certain page by it's template and id? We have a site that's been migrated to CMS 8 and a function that uses this has stopped working.

In earlier versions it was possible to access it as such: mywebsite.com/myTemplate.aspx?id=82 

#144743
Feb 18, 2016 11:41
Vote:
 

No need for a template any more. The URL structure is as follows:

http://[your-site]/EPiServer/Cms/#viewsetting=viewlanguage:///[content-langauge]&context=epi.cms.contentdata:///[id-of-the-content]

So for your example you should be able to use something like:

http://www.yoursite.com/EPiServer/Cms/#viewsetting=viewlanguage:///da&context=epi.cms.contentdata:///82

#144746
Feb 18, 2016 11:51
Vote:
 

But this is only for logged in users. I want to request the site as a visitor.

We have an old javascript that fetches the ID of the page we want to insert and then builds a request from that.

#144750
Feb 18, 2016 12:04
Vote:
 

If you are using MVC this will probably not be possible without some customisation. I've never tried it with WebForms in CMS 7+ if I am honest.

It sounds like there may be some alternatives - what is your specific requirement?

#144752
Feb 18, 2016 12:07
Vote:
 

If there's no other way, maybe I should rewrite the code then.

We have a site with a control on it. The control has data that's changing through ajax depending on what option the visitor is clicking on. The list of options is a li with a data-attribute with the ID of the page that is supposed to be fetched. On the onClick event the script fetches that page and displays it. I will try to rewrite it if it's not possible anymore to fetch a site only with ID through the browser.

#144753
Feb 18, 2016 12:11
Vote:
 

One elegant way to solve the problem would be to simply render the fully qualified URL into markup for AJAX request and let the code continue as before.

#144754
Feb 18, 2016 12:16
Vote:
 

Yeah, I thought so to. Will do that. Thanks for the help!

#144755
Feb 18, 2016 12:19
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.