Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I look for how to get content (ideal from cache) by URL with multiple hostnames in custom API controller UmbracoApiController. I was find method UmbracoContext.Content.GetByRoute but I don't know how to get content for specific hostname / domain.
For example, how find content for example.com/en/home and anotherdomain.com/en/home. Content this pages is not the same.
If i set this url to parameter in function UmbracoApiController then I always getnull or error.
If you have specific multiple custom hostnames set on your Umbraco site to different root nodes in the content tree - then you can still use GetByRoute..
but you need to prefix the relative path you are looking for with the id of the Root node for that site domain..
where 1234 is the id of root node for one site, and 1235 is the root node for another...
I know this is a V7 package PageNotFoundManager by TimGeyssens, but this code gives you a bit of a gist of how the GetByRoute works in a multi site Umbraco implementation.
Hope that helps steer in the right direction.
This doesn't seem to work inside a LastChanceContentFinder
What problem is occurring?
There is a V8 version of the UmbracoPageNotFoundManager, that has an example of GetByRoute:
That is registered as a LastChanceContentFinder
that it might be helpful to compare with.
@Jojo, the comment you replied to appears to be spam, I've flagged it as such (hence it's removed from this thread). Frustrating, I know.
When I use following URL in browser then it prompt me to download a text file with JSOn content.
Now I want to create a php page. I want that when I call this php page, it should call above URL and get content(json format) from file and show it on screen.
How can I do this ??
If you are prompted to download a JSON file, your browser has incorrect settings (default is to display JSON content)
In PHP, you can simply call "$result = filegetcontents ('UMBAPIURL')". In the variable $result you will have the content of JSON from the UMB API.
You can use the PHP function "json_decode()" to decode JSON to an object.
Alternatively, use functions / libraries other than cUrl ...
(I'm also a PHP programmer)
I just don't understand what this has to do with this post (this is .Net technology).
PS: You must first have the UMB API programmed
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted