Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Upgrading to DW 9.6.1 Missing Page Tags

Upgrading to DW 9.6.1 Missing Page Tags

Kevin O'Driscoll
Reply

In a .cshtml I used to be able to do;

string searchUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl((Int32)thisPage.Area.get_Value("dwareasearchpageid"));

And so I guess Area.get_value is now depricated but actually the Template Tag is not: https://doc.dynamicweb.com/template-tags/content/content/pages#DwAreaSearchPageID

and it is still in the TemplateTags() with the value winking at me!

This was really useful doing searches from any page within that page's area. How do i now get this value in a cshtml eg on a paragraph or an action= url on a form???

Rgds Kevin

 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

H Kevin

You can use the PageService.GetFirstModulePageForArea : https://doc.dynamicweb.com/api/html/51957554-dfd0-16a8-c9f9-b229e6b4d2da.htm

Like this:

Services.Pages.GetFirstModulePageForArea(area.ID, "Searchv1")

BR Nicolai

Votes for this answer: 1
 
Kevin O'Driscoll
Reply

Magic thanks Nicolai

 

You must be logged in to post in the forum