Fairly new to Umbraco/XSLT, currently using 4.5.2.
My problem is as follows:
I need to make a "Default" set of metadata that is controlled/edited in one location (home node), each page that is created by default uses this metadata. Now if the user wants to provide different metadata for that page they can add the custom metadata from a tab on that page. Make sense?
I use this mechanism all the time. What I do is create a master document type called SEO and all content doctypes use this as the master. You could create several doctypes with the same property aliasses as well, but one single master is easier.
Then I create a Tab called SEO and add the following properties (I only mention aliasses)
metaTitle
metaKeywords
metaDescription
Then you can reference these items in your template using (Insertbefore and after will output the Meta Tag)
Because you are using the recursive parameter it will look at the currentpage and if it can't find the item it will go all the way to the top node to determine the metadata.
Thank you for your reply! I'm close but not close enough!
So currently I have 2 Document Types used for creating pages. Home and Content (Home is just used for Home node, Content is used for all other pages)
Now when you say "create a master document type called SEO and all content doctypes use this as the master" ... I have created this Document Type (SEO) and now I want Home and Content Document Types to have SEO as there master...how do I do this?
Now do I create a new Root node with Document Type SEO to set my default SEO?
metadata - Default set with override
Hello,
Fairly new to Umbraco/XSLT, currently using 4.5.2.
My problem is as follows:
I need to make a "Default" set of metadata that is controlled/edited in one location (home node), each page that is created by default uses this metadata. Now if the user wants to provide different metadata for that page they can add the custom metadata from a tab on that page. Make sense?
Any help would be great!
Owen
Hi,
I use this mechanism all the time. What I do is create a master document type called SEO and all content doctypes use this as the master. You could create several doctypes with the same property aliasses as well, but one single master is easier.
Then I create a Tab called SEO and add the following properties (I only mention aliasses)
Then you can reference these items in your template using (Insertbefore and after will output the Meta Tag)
<umbraco:Item field="metaKeywords" insertTextBefore="<meta name="keywords" content="" insertTextAfter="" />" runat="server" recursive="true"></umbraco:Item>
Because you are using the recursive parameter it will look at the currentpage and if it can't find the item it will go all the way to the top node to determine the metadata.
Hope this helps you,
Richard
Hi Richard
Thank you for your reply! I'm close but not close enough!
So currently I have 2 Document Types used for creating pages. Home and Content (Home is just used for Home node, Content is used for all other pages)
Now when you say "create a master document type called SEO and all content doctypes use this as the master" ... I have created this Document Type (SEO) and now I want Home and Content Document Types to have SEO as there master...how do I do this?
Now do I create a new Root node with Document Type SEO to set my default SEO?
Thanks, any help is much appreciated!
Owen
Hi Owen,
If you already have a doctype it's better two add the SEO tab to both Home and Content node, all other stays the same..
Cheers,
Richard
Hi Richard,
Thank you, I understand what you mean now.
Owen
is working on a reply...