Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Urlname is empty after upgrading

Urlname is empty after upgrading

Daniel Hollmann
Reply

Hi DW. I have a problem getting the URL for a page, i'm finding using navigationTag, and the urlname property.

I do something like this:

pageService = new PageService();
Page p  = pageService.GetPageByNavigationTag(areaId, navigationTag);
var url = p.UrlName;

 

I can get some other values from the page item, so It's not like the pageservice does not give me the correct page.

I remember that I had this working in 9.10.12 but after upgrading to 9.10.14 (and also in 9.10.16) this is not working anymore?

The url name  https://doc.dynamicweb.com/api-docs#article=bc135c9d-7788-f7c3-84c5-a6d0222b7d8e does not seem to be depricated, so
is this a platform error or is the a new and better way of getting a url to a page found with the pageservice?

 

 


Replies

 
Nicolai Pedersen
Reply

Neither the Content.Page or the Content.PageService has any updates since 9.10.0. So maybe something else...

When you call this - what is the ID of the page that is returned? And how does the properties of that page look like when seeing that in the backend?

 
Daniel Hollmann
Reply

I get the same Id from the API, as in the backend, and the properties of the page, also looks correct.

 
Nicolai Pedersen
Reply

Can you show a screendump of that page and the ID you get back in the debugger?

 
Daniel Hollmann
Reply

I have attached images for my debugging session, backend pageview and backend properties view

 

I also get the Box_Hover_Color that I try to get from the item

2021-10-12_16h29_00.png 2021-10-12_16h30_18.png 2021-10-12_16h32_45.png
 
Nicolai Pedersen
Reply

Thanks, but you do not have the URLName property in your screen dump...

 
Nicolai Pedersen
Reply
This post has been marked as an answer

If you are looking for the friendly url of that page, use Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(789);

Votes for this answer: 1
 
Daniel Hollmann
Reply

Thanks Nicolai.

That worked. I was just getting the URL by the wrong method, the SearchEngineFriendlyURLs
Did the trick for me!

 

You must be logged in to post in the forum