Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi I am new to Umbraco, However I have an existing site I am trying to improve for SEO.
The dynamic article pages have been setup where dynamic articleTags pages use the same page title so aren't listed by the search engines.
I am trying to reference the articleTags and populate the title, therefore create unique titles for each dynamic page created where:
https://domainname.com/article?tag=test1
Would produce:
In my main template I have the following but I must be missing something as it doesn't output the articleTags used in the page.
@if (Model.HasValue("articleTags")) { <title>@home.Sitename | @Model.Name | @(Model.Value<string>("articleTags"))</title> } else if (Model.HasProperty("metaTitle") && Model.HasValue("metaTitle")) { <title>@home.Sitename | @Model.Name | @(Model.Value<string>("metaTitle"))</title> } else { <title>@home.Sitename | @Model.Name | @(home.Value<string>("defaultMetaTitle"))</title> }
Help Appreciated. Regards Lee
Hi Lee,
according to the docs the tags can be referened like this:
@if(Model.GetProperty("articleTags") !=null){ <ul> @foreach(var tag in Model.GetProperty("articleTags").Value<IEnumerable<string>>()){ <li>@tag</li> } </ul> }
https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Tags/
Thanks Brendan, Yes got there in the end also here's the code snippet that works for my title, but absolutely not !=null was key in the if statement:
@if (articleTag != null) { <title>@home.Sitename | @Model.Name | @articleTag</title> } else if (Model.HasProperty("metaTitle") && Model.HasValue("metaTitle")) { <title>@home.Sitename | @Model.Name | @(Model.Value<string>("metaTitle"))</title> } else { <title>@home.Sitename | @Model.Name | @(home.Value<string>("defaultMetaTitle"))</title> }
Thanks for your support, regards Lee
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
SEO Dynamic title using articleTags
Hi I am new to Umbraco, However I have an existing site I am trying to improve for SEO.
The dynamic article pages have been setup where dynamic articleTags pages use the same page title so aren't listed by the search engines.
I am trying to reference the articleTags and populate the title, therefore create unique titles for each dynamic page created where:
https://domainname.com/article?tag=test1
Would produce:
In my main template I have the following but I must be missing something as it doesn't output the articleTags used in the page.
Help Appreciated. Regards Lee
Hi Lee,
according to the docs the tags can be referened like this:
https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Tags/
Thanks Brendan, Yes got there in the end also here's the code snippet that works for my title, but absolutely not !=null was key in the if statement:
Thanks for your support, regards Lee
is working on a reply...