Developer forum

Forum » CMS - Standard features » export slug article

export slug article

Cristina Santos
Reply

We want to export all blog articles.

We can do it through Data Integration, but we need the slug and we dont know how to do it....

How can we export the slug (url) for each post? 

So far we have tried like this:


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Cristina

You cannot - it is calculated real time and not part of the data in Dynamicweb.

You can write a little template that generates a table with the URLs

Each blog post has an id - pageid.

By using Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(pageid) you will get the URL for that given pageid and can then move them to your export.

If you can also create a field on the BlogArticle item type and by using the code above, write the URL to the item table ín that field so it is exportable. Then you just have to run the template before an export.

BR Nicolai

 
Cristina Santos
Reply

Ok, thank you very much!!

Regards,

Cris

 

 

You must be logged in to post in the forum