2

Ok, I could be over complicating things, but here is what I am up against and what all I have tried...

I am working on rebuilding a site in which they do not want their users to have to worry about managing their SEO. (Keywords, description, images, etc...) But they want their site to be social media friendly for all of the social sites out there. I have narrowed the social sites to facebook, twitter, linked:in, google+, and pinterest. They also have specific "looks" that they want for each one. This means I have had to review the developer API's and find the templates that match what they are after and build towards those layouts. All this said, I need a way to gather all of this in a clean sweep. (If possible)

I was using SEO Lite in conjunction with Mark's IfElse. I liked it, but that didn't quite get them what all they were after. I switched to NSM Better Meta and tried to use embed templates to gather all of the information this way.

The problem was that each of these required someone to manually enter the data. I then decided to just use a snippet. The problem is that the snippet doesn't do anything for keywords. Automatic keyword generation is a real stumper. I have ideas on how to achieve it, but it would require something extra... plugin, extension, combination, etc... I am open to any and all ideas.

Here is the snippet. I have removed all of the customer info. The logic statements are because different channels use different fields. I could make three different ones, but this worked so I just left it.

    <!-- Geo Data -->
    <meta name="geo.position" content="my x,my y" />
    <meta name="geo.placename" content="City, ST" />
    <meta name="geo.region" content="US-ST" />

    <!-- Place this data between the <head> tags of your website -->
    <title>{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here</title>

    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <!-- Google Authorship and Publisher Markup -->
    <link rel="author" href="https://plus.google.com/member-id/posts"/>
    <link rel="publisher" href="https://plus.google.com/member-id"/>

    <!-- Schema.org markup for Google+ -->
    <a href="https://plus.google.com/member-id?rel=author" style="display:none;">Google+</a>
    <meta property="url" content="{current_url}" />
    <meta itemprop="name" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here">
    <meta itemprop="datePublished" content="{entry_date format='%Y-%m-%dT%H:%i:%s%Q'}">

    {if field_pair:total_rows > 0}
        <meta itemprop="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}">
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    <!-- Twitter Card data -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@username">
    <meta name="twitter:title" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here">

    {if field_pair:total_rows > 0}
        <meta name="twitter:description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}">
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <meta name="twitter:creator" content="@alamodeinc">

    <!-- Twitter summary card with large image must be at least 280x150px -->
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta name="twitter:image:src" content="{exp:low_replace find='/product_images/' replace='/product_images/_Twitter_Card_Image'}{field_pair:field}{/exp:low_replace}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta name="twitter:image:src" content="{exp:low_replace find='/product_images/' replace='/product_images/_Twitter_Card_Image'}{field_pair:field}{/exp:low_replace}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    <meta name="twitter:domain" content="domain.com">

    <!-- Open Graph data -->
    <!-- Used by Facebook and Linked:In -->
    <meta property="og:title" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="{current_url}" />

    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    {if field_pair:total_rows > 0}
        <meta property="og:description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <meta property="og:site_name" content="{site_label} - company name here" />
    <meta property="article:published_time" content="{entry_date format='%Y-%m-%dT%H:%i:%s%Q'}" />
    <meta property="article:modified_time" content="{edit_date format='%Y-%m-%dT%H:%i:%s%Q'}" />
    <meta property="article:section" content="Article Section" />
    <meta property="article:tag" content="Article Tag" />
    <meta property="fb:admins" content="admin-id" />

    <!-- Pinterest Article Pins - not picked up from earlier tags -->
    {exp:tagger:tags entry_id="{entry_id}"}
        <meta property="article:tag" content="{tagger:tag_name}" />
    {/exp:tagger:tags}
1

there is an easier way to do this with SEO Lite, check out this gist which has an example:

https://gist.github.com/bjornbjorn/4039233

| improve this answer | |
  • Hey Bjorn. Thanks for that. I was looking through and it appears to only work with text, file, and assets. The fieldtypes I am using are wygwam, rich text, editor, etc. The images that are uploaded into the copy blocks by editors are what I am trying to grab. In the settings, I have each image location with an image manipulation to automatically resize the appropriate social media images to their required specs. Is there a way to perform this using SEO Lite that I have missed? I would like to be able to simplify this greatly, I just haven't been able to find a way as of yet. – W3bGuy Mar 22 '14 at 23:18
  • aha, ok .. there's no way to grab images from a wysiwyg field in SEO Lite unfortunately. I have pondered creating a more advanced version of SEO Lite for quite a while which would deal with social sharing content but haven't gotten around to it yet. The minimal solution from the gist has worked for me so far as I always seem to have an image field and some text/intro field.. but auto-resizing would be nice for sure, especially since Facebook seem to change these sizes every now and then. – Bjørn Børresen Mar 24 '14 at 12:48
  • Agreed. I also looked into building one, but with a couple of good choices already out there... wink wink I thought it would be easier to amend rather than recreate. FB, Twitter, Pinterest, Google+, LinkedIn, etc., all have their own methods and sizing. What I thought would be a good idea is to allow a checkbox for each type you wish to include w/optional input for your img locations. (Set in your file mgmt settings. If nothing is set then use the default img) Only if present, w/an additional dropdown for the social media that offer templates like twitter, pinterest, and LinkedIn. – W3bGuy Mar 25 '14 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.