Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Owen Hope 119 posts 140 karma points
    Nov 17, 2010 @ 00:58
    Owen Hope
    0

    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

     

     

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Nov 17, 2010 @ 08:48
    Richard Soeteman
    0

    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)

    • metaTitle
    • metaKeywords
    • metaDescription

    Then you can reference these items in your template using (Insertbefore and after will output the Meta Tag)

    <umbraco:Item field="metaKeywords" insertTextBefore="&lt;meta name=&quot;keywords&quot; content=&quot;" insertTextAfter="&quot; /&gt;" 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

     

  • Owen Hope 119 posts 140 karma points
    Nov 17, 2010 @ 19:06
    Owen Hope
    0

    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

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Nov 18, 2010 @ 08:28
    Richard Soeteman
    0

    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

  • Owen Hope 119 posts 140 karma points
    Nov 18, 2010 @ 20:38
    Owen Hope
    0

    Hi Richard,

    Thank you, I understand what you mean now.

     

    Owen

Please Sign in or register to post replies

Write your reply to:

Draft