Developer forum

Forum » Development » Getting the SEO URL of a News Article

Getting the SEO URL of a News Article

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I implemented a custom URL provider for news which works great. To enable "Like this" for Facebook, I want to render the full URL to the article in some HTML.

Problem is that the URL parser seems to look for href and other attributes, while my URL is place in some arbitrary HTML. I end up with this:

<a href="/nieuws/customNewsTitle.aspx?PID=31&Action=1">Dorien Rose</a>
...
<div class="addthis_toolbox addthis_default_style"
   addthis:url='http://www.sapphlingerie.com/Default.aspx?ID=15&PID=31&Action=1&NewsId=123' ....

Only the real href has been converted, while the addthis url is still in Default.aspx?ID= format.

In both cases, I use News:Href as the link:
 
<a href="<!--@News:Href-->"><!--@News:Heading--></a>
<div class="addthis_toolbox addthis_default_style"
    addthis:url='<!--@Translate(baseurl, "http://www.sapphlingerie.com", global)--><!--@News:Href-->'...

I thought I could fix this by implementing a NewsListItemTemplateExtender, but at the time the extender fires, the SEO URL isn't known yet.

Is there a way to programmatically retrieve the SEO link for the news page, taking into account the URL Provider? Or is there a way to influence the URL parser so it also looks at non hrefs?

Thanks in advance,

Imar
 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
You should be able to call
SearchEngineFriendlyURLs.getSearchFriendlyUrl("Default.aspx?ID=23&PID=30&M=NewsV2&Action=1&NewsId=5", "")


Votes for this answer: 0
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Perfect. If only all things were so simple..... ;-)

Thank you.

Imar

 

You must be logged in to post in the forum