[Product-Developers] kupu base href
derek.richardson at gatech.edu
Tue May 13 18:34:01 UTC 2008
I am attempting to rewrite the urls generated by kupu into a different
format (I'm moving the content between sites and rearranging in the
process and need links to be uuids, not normal hrefs. I'll transform
them back into normal hrefs on the other side.). So, I need to take a
kupu url and traverse to the object it represents.
Kupu generates only relative urls for internal links and depends on the
base element's href attribute for resolution. So, I need to resolve the
relative urls into absolute urls, of which I can then chop the front
part and throw it away, leaving a string I can pass to restricted traverse.
The problem is that I cannot figure out how plone generates the base
href for a page. For a folder, it seems to be that folder. But, for a
page, it seems to be the folder the page is in. This surprised me.
This may be as convoluted as it gets, but, having been surprised once,
I'd like to see the code plone uses to generate the base href. Does
anyone know where it lives? Or does anyone know a better way to do what
I'm trying to do?
More information about the Product-Developers