Hi
Is it possible and if so how to set the meta keywords on a page with the API?
Hi
Is it possible and if so how to set the meta keywords on a page with the API?
Bump!
Where from?
Page.Keywords is one option: https://doc.dynamicweb.com/api-docs#article=28063288-5739-d758-4a05-7e53d73e99a3
PageView.Meta is another option.
Depends on what you need it for.
I do not think we render keywords to the frontend anymore as it is kind of deprecated...
Hi Nicolai
I am not sure I get what you mean by "Where from?". I just want to overwrite the meta keywords tag in the markup.
I have tried adding these lines to the master template:
PageView.Meta.AddTag("keywords", "my special keywords")
That didn't render my keywords. So have also tried:
Because it has meaning... You are setting the value too late in the rendering.
The master template is what is rendering the meta data - so adding things to the meta data in that template is a little too late, see this thread from today:
https://doc.dynamicweb.com/forum/cms-standard-features?ThreadID=74365
As a side note, using meta keywords these days...? For what reason?
Got it working by doing it this way:
public class PageLoaded : NotificationSubscriber { public override void OnNotify(string notification, NotificationArgs args) { Standard.Page.LoadedArgs loadedArgs = args as Standard.Page.LoadedArgs; loadedArgs.PageViewInstance.Meta.AddTag("keywords", "my special keywords"); } }
Thanks Nicolai
You must be logged in to post in the forum