1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

meta description tweak

Discussion in 'Styling and Customization Questions' started by onelife69, Apr 22, 2012.

  1. onelife69

    onelife69 Member

    Hi all,

    I'm looking to include the post title text into the meta description tag, just before the text xf normally grabs for the description. Can anyone tell what code I would need to put in to do this in page_container?

    For example:

    post title: bag of widgets
    post text: a post that should contain the title string but instead waffles on about something else
    current meta desc: a post that should contain the title string but instead waffles on about something else

    required tweak meta desc:bag of widgets a post that should contain the title string but instead waffles on about something else

    Any help would be gratefully appreciated
     
  2. onelife69

    onelife69 Member

    Would something like this work where I've added in the xen:raw $title - apologies I don't understand code.

    Code:
    <xen:if is="{$pageDescription.content} AND !{$pageDescription.skipmeta} AND !{$head.description}"><meta name="description" content="{xen:raw $title, xen:string wordTrim, {xen:helper stripHtml, {xen:raw $pageDescription.content}}, 150}" /></xen:if>
     

Share This Page