Adding segments to URL with UrlProvider + ContentFinder
Hi legends
Having some problems getting my UrlProvider+ContentFinder combo to do what I need. I want to store a stack of nodes in a central repository (ie /root/repo) but then reference them contextually with respect to the current page.
For example, if I'm on page /some/page, and there's a link to a node stored in the repo, named repo-node, the URL in the link should be /some/page/repo-node.
That's working fine when the page first renders, the link URLs are as I need. Clicking one though falls into a redirect loop, and ends up in a smoking pile of no good.
It seems that the provider is being hit multiple times for a single request, which doesn't seem right (and isn't happening on other providers on the same site).
Has anyone done similar and made it work all sweet and awesome? Can add code sample after lunch, but food is the priority right now...
I've changed my approach a little, but would still like to see if it's possible to achieve the original spec.
I think the issue is that when the content finder has done its magic and returns the IPublishedContent item, I don't have a reliable way to lookup the URL of the page from where the request was generated:
Page is rendered - url provider sets urls for links
Link click - content finder gets content, url provider called
In the second url provider call, the context has changed so I no longer know about the page that sent the request, so I can't build the correct URL.
Adding segments to URL with UrlProvider + ContentFinder
Hi legends
Having some problems getting my UrlProvider+ContentFinder combo to do what I need. I want to store a stack of nodes in a central repository (ie /root/repo) but then reference them contextually with respect to the current page.
For example, if I'm on page /some/page, and there's a link to a node stored in the repo, named repo-node, the URL in the link should be /some/page/repo-node.
That's working fine when the page first renders, the link URLs are as I need. Clicking one though falls into a redirect loop, and ends up in a smoking pile of no good.
It seems that the provider is being hit multiple times for a single request, which doesn't seem right (and isn't happening on other providers on the same site).
Has anyone done similar and made it work all sweet and awesome? Can add code sample after lunch, but food is the priority right now...
I've changed my approach a little, but would still like to see if it's possible to achieve the original spec.
I think the issue is that when the content finder has done its magic and returns the IPublishedContent item, I don't have a reliable way to lookup the URL of the page from where the request was generated:
Page is rendered - url provider sets urls for links Link click - content finder gets content, url provider called
In the second url provider call, the context has changed so I no longer know about the page that sent the request, so I can't build the correct URL.
I think.
is working on a reply...