You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code i guessed at is something like :
{
var metaTags = metaFieldsService.Get(Model, true);
metaTags.SetValue("canonicalUrl", "I want to add something more to the url depending on something");
}
but nothing is updated. If i debug i see the metaTags do get my change but I assume the when the tag is rendering it gathers its own data again ignoring what im trying to do.
Is there any way i can update the canonicalUrl so that meta-fields will write out what i want at rendering time?
I get i could just write my own logic and read from the same metaTags service data, but for just changing 1 item it would be nice to not have to :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Im trying to update the canonicalUrl before the tag is used and hoping that it will take my new canonicalUrl.
The umbraco page im using has a pager component, which adds "page={pagenr}" to the url, and i want the canonical to contain it also
:
rel="https://mysuper.domain/pagewithpager?page=10" instead of "https://mysuper.domain/pagewithpager"
The code i guessed at is something like :
{
var metaTags = metaFieldsService.Get(Model, true);
metaTags.SetValue("canonicalUrl", "I want to add something more to the url depending on something");
}
but nothing is updated. If i debug i see the metaTags do get my change but I assume the when the tag is rendering it gathers its own data again ignoring what im trying to do.
Is there any way i can update the canonicalUrl so that meta-fields will write out what i want at rendering time?
I get i could just write my own logic and read from the same metaTags service data, but for just changing 1 item it would be nice to not have to :)
Beta Was this translation helpful? Give feedback.
All reactions