META tags

New Member
44 0 0
How would I go about making separate META tags and page titles for each page? I'm getting the same tags on every page. Thanks.
0 Likes
Excursionist
1027 0 8

in theme.liquid you should have something like this.


 <title>{{ shop.name }} - {{ page_title }}</title>

For dynamic meta tags, that would require something like maybe cases.



{% case 'page_title' %}

{% when 'Welcome' %}
 <meta name="description" content="Description here"/>
 <meta name="keywords" content="Keywords here" />

{% when 'Product-Foo' %}
 <meta name="description" content="{{ product.description }}"/>
 <meta name="keywords" content="keywords here">

{% endcase %}
Dan - http://www.xtremechargers.com
0 Likes
New Member
44 0 0

Thanks Dan.

Where would the dynamic code go? What’s a “Product-Foo”?

0 Likes
Excursionist
1027 0 8

Should go in the head section of the theme.liquid file.

Product-Foo is just a name I came up with to illustrate the title of product page.

Dan - http://www.xtremechargers.com
0 Likes
New Member
44 0 0

Gotcha – Thanks Dan!

0 Likes
New Member
63 0 0

Hi Dan, Yesterday I came across a website, whois.domaintools.com , it gives you information about your domain. In the section for “front page information” , under “Meta Relevance” it said “No terms. Site needs Meta Description.” I had a look in my admin, in Theme.Liquid, but was not sure what to look for. What would a Meta Description look like ? And where is it usually placed ? Thanks a lot, Mickmac

0 Likes
Excursionist
1027 0 8

Hi Mickmac,

The meta tags would go inbetween the <head> </head> tags usually right under the title tags.

The meta description is usually a text string that gives a description of the site. It would look like this.


 <meta name="description" content="Description goes here" />
Dan - http://www.xtremechargers.com
0 Likes
New Member
63 0 0

Thanks Dan, You were right, it was there between the <head> </head> tags. I wonder why that report on my site said ” No terms.Site needs Meta Description” ? What would happen if I added another one, would that cause problems ? Mickmac

0 Likes
New Member
10 0 0

I have a couple of problems with this approach.

1. I use HTML in my description…or I guess textile is putting formatted text into the db for my description, so when I use {{ product.description }} in the meta, I get broken html and some browsers dont render correctly.

So how do I de-textile-ify my description so I can use it in the meta?

B. I thought it was natural to use my {{ product.tags }} in the keywords meta, but they come out as a single string.

How do I generate a comma delimited list from {{ product.tags }}?

tia,
dan

-- http://www.pavitracreations.com
0 Likes
New Member
10 0 0

bump

-- http://www.pavitracreations.com
0 Likes