In the example for the cshtml file you have this:
2. Create a new partial view _uSeoPro.cshtml and copy the code below.
In the code you have this for the title:
<title>@title | Static Title End</title>
Is there an error with the : Static Title End.
I cant get the default, which i have set on the datatype.
I'm currently trying to do the same. The only options I can think of right now...
Store the static title in the page model. Of course the downside to this would be that if the static title changes all nodes that use the datatype would have to be republished.
Retrieve the prevalue from the datatype in the view. To my knowledge there is not a way to do this without knowing the datatype id or guid. Ex. https://our.umbraco.org/wiki/reference/umbracolibrary/getprevalues. I believe this hits the database, so you'd want to find some way of caching it.
For my current case, I'll probably just modify the plugin and go with option 1.
Yes I have deliberated with both ideas and for the reasons you have given I have not implemented. Updating multiple nodes would be a nightmare and hitting the db is not a great solution.
The way I have started to use it is to have a StaticSiteTitle property on my home node.
Static Title End
Hi Thanks for sharing.. this is great.
I have one question
In the example for the cshtml file you have this: 2. Create a new partial view _uSeoPro.cshtml and copy the code below. In the code you have this for the title:
Is there an error with the : Static Title End.
I cant get the default, which i have set on the datatype.
René
Hi Rene,
Sorry for the late reply - only just seen the post.
I could not find a way to get this info from the data type settings - so currently you have to hand write the static title in to the .cshtml file.
Sorry for any inconvenience - if I find a solution you will be first to know :-)
Regards, L
@Luke,
I'm currently trying to do the same. The only options I can think of right now...
Store the static title in the page model. Of course the downside to this would be that if the static title changes all nodes that use the datatype would have to be republished.
Retrieve the prevalue from the datatype in the view. To my knowledge there is not a way to do this without knowing the datatype id or guid. Ex. https://our.umbraco.org/wiki/reference/umbracolibrary/getprevalues. I believe this hits the database, so you'd want to find some way of caching it.
For my current case, I'll probably just modify the plugin and go with option 1.
Hi Dan,
Yes I have deliberated with both ideas and for the reasons you have given I have not implemented. Updating multiple nodes would be a nightmare and hitting the db is not a great solution.
The way I have started to use it is to have a StaticSiteTitle property on my home node.
I then reference it @CurrentPage._StaticSiteTitle
Thank you for your help :-)
Regards, L
is working on a reply...