Actualités développement .NET

Actualités DotNetNuke Pro et Communitaire et autres technologies mises en oeuvre par DevPCI.
30

Many of us expect that enhancement "Addition of "URL Name" field to Page Properties" come soon, but there is not yet any expect delivery date.

How does it actually works :

In page settings, we only have a field for Page Name, and not yet fiels for Url Name.
With HumanFriendly Urlformat for DNNFriendlyUrl, the Page Name is used in the Menu, and in the Url. For exemple, if Page Name is "MyPageName", we 'll have in Menu "MyPageName" and in Url : "MyPageName.aspx"

What does we want ?

We want a new field to be able to specify the Url (for SEO reason in general), and a Page Name different than the Url. 

What can we do ;-) ?

Get a tiers module but it is not free....

Change DotNetNuke core but we don't want to have a non standard DotNetNuke dll and get out of the simple update process....

As we won't change the url building process, perhaps we can change the Page Name at an other level ? So witch level ? At Resx / translation level.   

The workaround : 
If you use a fresh DotNetNuke and enable an other language (not multilanguage content), you have perhaps seen that the home page always have an url finishing with /home.aspx but in the menu, in french for exemple the home page well appeared as "Accueil" 

This is done by a resource in GlobalResources.fr-Fr.resx :

So, we now have all we need to do a clean url with a correct Page Name in Menu.

For exemple, i'll set "My_wonderful_url_for_seo" as Page name in page settings.

Next, i'll go to GlobalResources.xx-yy.resx (where xx-yy is my language code) and add a resource named:  //My_worderful_url_for_seo.String   and with value    MyPageMenuName then save file.

Now, go back to your site and see the result :

That do the trick ;-) !!!

Hope this help.