Developer forum

Forum » Templates » Modify title tag

Modify title tag


Reply
I am using the new template engine.

As default the title tag is the page name or what is specified as titel in the backend.

How can I add a extra standard text such as the company name that allways will be shown at the end of the title e.g. "This is a page title - Company name"?

Thanks

Replies

 
Nicolai Høeg Pedersen
Reply
You can do that from code.

Use the Dynamicweb.Notifications.Standard.Page.OnOutput notification and set pageview.current.meta.title = pageview.current.title & " - companyname".

http://engage.dynamicweb-cms.com/api/extensibility/Dynamicweb~Dynamicweb.Notifications.Standard+Page~OnOutput.html

But you really do not want to do that - that is NOT good for search engine optimized pages. They will perform better if you do not add the company name.
 
Nicolai Høeg Pedersen
Reply
Just made a couple of changes of the layout parser - among them a possibility to keep your markup instead of Dynamicweb parsing it.

So what you want to achieve can be done like this
<title><!--@Title--> - company name</title>

Similar features are available for content placeholders and navigations.

The documentation have been updated (not published yet) and feature will be available with next service release.
 
Reply
Thank you!

That sounds very good!

 

You must be logged in to post in the forum