How do I go about accessing the current page's URL?
I am trying to dynamically generate Facebook Comments widgets on news and announcement pages. I would like these widgets to be page-specific so that the same comments don't appear on every single story or page.
This returns the appropriate page ID, but this doesn't link properly with Facebook. I need the actual page URL (http://website.com/parent_folder/page.aspx) to be inserted into the link.
You need to call the umbraco.library:NiceUrl function to convert the page ID to a URL. I think you could achieve this using the umbraco:Item tag with inline XSLT:
Display current page URL
How do I go about accessing the current page's URL?
I am trying to dynamically generate Facebook Comments widgets on news and announcement pages. I would like these widgets to be page-specific so that the same comments don't appear on every single story or page.
So far I've been playing with this code:
This returns the appropriate page ID, but this doesn't link properly with Facebook. I need the actual page URL (http://website.com/parent_folder/page.aspx) to be inserted into the link.
Should I be attempting this in XSLT instead?
try
<umbraco:Item field='pageID' xslt="umbraco.library:NiceUrl({0})" runat='server' />
Hi,
You need to call the umbraco.library:NiceUrl function to convert the page ID to a URL. I think you could achieve this using the umbraco:Item tag with inline XSLT:
If not, it's easy to do from XSLT:
Note, you might need to add the domain name before the Item tag, as NiceUrl won't return it unless you have some options set.
-Tom
Inline XSLT - nice! That worked perfectly! Thank-you.
is working on a reply...