|
767ba29f3738b05fd01c79cabe36321e
|
Creating Meta Tagsby mhromney75 - Member - 06:52PM, Apr 30, 2008 |
|
Hi Everyone, I have a couple questions about meta tags. (I don’t know much about HTML) First I couldn’t get this one to work. Second I couldn’t get this one to work the way I wanted so I had to modify it a little bit in order to get it to work see below. After doing this however I realized that if I did it this way I would have to create a snippet of code for all of my 300 products. So after looking at this code for a bit (remember I am a novice so this isn’t as apparent to me as it may be to the rest of you) I realized that the Meta Keywords portion is dynamic. So I thought I can just put that in my theme.liquid and it will pull whatever tags are on my product pages and turn them into keywords. So that is what I did. See below So I added this but I have noticed that for any page on my site that is not a product page it has this snippet of code with no keywords. So I have a couple questions on this (example: http://www.survivalmountain.com/collections/food) 1.Does anyone know how to make this more dynamic? So if it is on a collection page it will display the tags for that page or if it is on the product page it will display the tags for that page. Maybe there is a universal tag command I can put in the content section and it will pick up whatever tags are associated with the page and turn them into keywords. 2. I have also noticed that other websites have both the Meta Keyword & Meta Description. Do I need both? Can I make the Meta Description Dynamic also? |
|
|
Is there anyone out there that can help me on this?
|
|
|
I tried this code recently and it didn’t work. Does anyone have any advice on how I can install some meta tags on to my site that aren’t the same on each page? Any help would be appreciated.
|
|
|
First of all: there’s a difference between two variables that look very similar but that are actually quite different: 1) page.title (with the period):this refers only to the title of a page.liquid template, e.g., the one that might be called “About-us”. There is no “page.title” variable that refers to the product, the collection, or any other template than page, so your code above, that starts 2) page_title (with the underscore):this is a variable that refers to each template differently, as follows:
You can test this by temporarily putting the variable: So if you put Now some code: Code explanation:The above will give you the following results: For the collection template:Description: The title of the collection, followed by an excerpt of the collection description, if you’ve made one. Keywords: Collection title + tags for that collection. For the product template:Description: The product title, followed by an excerpt of the product description, if you have one. Keywords: Product title + tags for that product. For the page template:Description: The page title, followed by an excerpt of the page article. Keywords: Page title. For the blog template:Description: The blog title.
Keywords: Blog title. All other templates including index:Description: The name of the shop, followed by an excerpt of the frontpage article. Keywords: A list of the shop collections that are in the Main Menu. There are two variables you can change: maxwords : to increase or decrease the number of words in the excerpts. indexblog : which refers to a blog called ‘frontpage’. If your blog is called somwthing else, you can change that, without messing with the code. Which you are otherwise free to mess with as you please, of course. Though I actually think the — Last edited 12:31PM, May 07, 2008 |
|
|
Christina Thanks!! This works great.
|
|
|
see also continuation of meta description discussion
|
|
|
I was finally able to do this – almost. Pretty slick! Meta Descriptions work fine throughout except Keywords for my Index page. Comments say, “All other templates including index: Description: The name of the shop, followed by an excerpt of the frontpage article. Keywords: A list of the shop collections that are in the Main Menu.” It is this latter part that is not visible. I tried to puzzle out, but could not. What did I miss?
|
|
|
Do you use the default menu provided by shopify? The one that’s called “Main Menu”? The above code assumes that; I shouldn’t have hard-coded that, but there you go. If your collections are listed in a linklist that is called something else, then replace the handle “Main-Menu” in the last line above by the handle of your linklist, like this: Instead of this:
do this:
or maybe i should have set “main-menu” lowercase. Anyway, try that & see. Tell me if it doesn’t work.
|
|
|
I think we are SOL. Our design uses hard coded links. See page source at: http://www.aplusenv.com/ So, I am wondering if your other Meta Tag code solution – http://forums.shopify.com/categories/6/posts/19827 – can be modified to handle Key Words? I have played with the Meta Descriptions blog articles, etc. and it is perfect for my needs! I like it because it provides a lot more control over content.
|
|
|
hmm. what does SOL mean? Looking at page source will not tell me whether something’s hard-coded or not, & I very much doubt it would be. That would be just too SOL for words. In your admin → navigation, check what linklists you have, and then see which links connect to the collections. Put in the name of that linklist. I’m glad you’re liking the metadescriptions blog solution. You could do that for keywords, too, make a new blog called, um, let’s see…”keywords” and change the code correspondingly, mutatis mutandis et cetera.
|
|
|
My admin → navigation shows no linklists, just: Main Menu → Home Footer → Home, Resources, Events, Classes, Contact Us, Privacy None of which I want to use as Keywords I am going to try to modify your metadescriptions blog solution for “keywords,” and since I have no idea what I am doing it should be …. um …. an adventure? 2.5 hours Later … It was an adventure and it works! Thanks a bunch Christina! — Last edited 10:30PM, Jun 07, 2008 |
|
|
congrats!! i love it when that happens. weird nav setup you got there though. you’re clearly not using your Main Menu linklist. if you just add links there for each of your collections, the above code should work, and give you the collection names as keywords for your index page. But I guess you’ve gone with the blog. While you’re at it, impossibly refining your head section, you might as well stick the title tags in there too.
|
|
|
I am going to try to use this to display user feedback on product pages. You rock Christina. ---
Chelsea My Shopify Site: Other Shopify Integrations:
|
|
|
ooo. why thank you. glad you like it.
|
|
|
I sleep on a wool bed too; along with my wool bedding, it’s the best sleep I have ever had. I will post to this thread when I have figured out the user feedback using the code above. Wool rules. ---
Chelsea My Shopify Site: Other Shopify Integrations: — Last edited 04:04AM, Jun 10, 2008 |
|
|
Christina, thanks for the code, I’ll try it. Chelsea, I’m looking forward to your code for user feedback. Lastly, my little lamb is sleeping on a sheepskin since birth and still loving it 2 years later. ---
|
|
|
I will keep working on the user feedback stuff tonight; slow going, as my grasp on liquid is tenuous, but I think I have it half working at least. Here is what I intend to be able to do with it when done: - Define the content for unspecified pages in a Feedback blog that would display on a site Aside: That’s wonderful FannyA; my daughter Raechel is 9, and she sleeps on a wool and natural latex bed, as well as under a wool duvet. (So do I for that matter.) It has improved my allergies and asthma considerably, to the point that I no longer needing an inhaler. ---
Chelsea My Shopify Site: Other Shopify Integrations:
|
|
|
Hi, I’m back again… I installed the code above that Christina supplied, the description is working somewhat, but it doesn’t put a comma between my meta keywords, I would also like to be able to specify the keywords I would like to use on each page without having to use the links list. Does anyone how I can get around using the link list as my keywords? Thanks in advanced! Lee Ann
|
|
|
Christina, shall I just copy and paste your code into theme.liquid? Edited to add ---
— Last edited 07:26PM, Jun 15, 2008 |
|
|
Hi Folks, I have errors with IE. HTML validator says that <meta> are not closed. I added </meta> at the end of each code line Christina gave us and now he says “discarding unexpected </meta>”. What to do? Please could somebody help me? ---
|
|
|
I think I fixed it…. sorry it’s so blurry for me ;-) ---
|
|
|
Fanny, you found a bug in my code – sorry about the trouble it’s caused you. The problem arises because I was sloppy about closing the self-closing meta tags. The proper way to do it, if you’re using an xhtml doctype (which you are) is: space – backslash – closing bracket. In some of the lines above, I didn’t put in the space, and in others, I’m even missing the backslash, egad! The right way: corrected code:
You have to get rid of the @leeann: if you want more customization of keywords, use the other meta tag method given here, and adapt it to work for keywords too, like JohnG did (see comments above). @JohnG: wanna share your adventurous code?
|
|
|
Christina, I’d be happy to share but it would duplicate what is already available. I used your code “right out of the box” – that is I cut and pasted it from your post to my theme.liquid between the <head></head> tags. I then created the metadescription blogs as explained in your post and it worked! Once I had the Descriptions part functioning, I took the same code and search/replaced the word “description” with “keywords” and put this directly under the metadescription code. Then I added metakeyword blogs and that’s it. Two things I’d like to improve/fix are (1) stripping out the page titles that display before each meta description and (2) eliminate the extra areas of white space before and after the meta tags. I’ve tried to figure out how to do both, but am stumped. Any suggestions?
|
|
|
ok. you can get rid of the page titles by removing all instances of the whitespace cannot be removed by us. it’s the trace left behind from processing all the conditional statements. the shopify crew would have to do something to their code to fix that, but i’m not sure that that is (or should be) a huge priority. it’s not very pretty, but it’s harmless.
|
|
|
Thanks Christina. For some reason, I am unable to strip the page title out of the meta keyword displays on my ‘collection’ pages. The code snippet in question is:
I deleted {{page_title}} from the “collection’ portion, but it still displays prior to the metakeywords. Is it being fed from the blog which, of course, has the same title? FYI, I want to retain the titles for all other pages, just not on the ‘collection’ pages. What am I missing?
|
|
|
Christina, and everyone. I hate to sound dumb but I have been reading these meta tag forums for hours and it doesnt all make complete sense to me yet. Where do I put this code in assets, and what variables do i change, with my own data? I simply need to incorporate meta descriptions and am at square 1. Though my site generates sales daily, I am a beginner with coding. Be gentle.
|
|
|
code doesn’t go into assets; it goes into templates.
|
|
|
so then I just replace the words “keywords” and “description” with my own? Do keywords need to be separated with comma or just space? thanks
|
|
|
Also do I have to change ‘page_title’ or anything to meet my handles?
|
|
|
bump
|
|
so then I just replace the words “keywords” and “description” with my own? No. Christina said: “copy and paste the code from here to your theme”. Also do I have to change ‘page_title’ or anything to meet my handles? No again. Christina said: “copy and paste the code from here to your theme”. Sorry to barge in. ---
http://wiki.shopify.com/Eleven_heavens Shopify Theme Work mllegeorgesand AT gmail DOT com
|
|
|
I thought thats what she meant but how am I supposed to determine what keywords to use? I would like to pick keywords most relevant. Thanks
|
|
|
Ok I am learning some of the lingo and I figured out most of this. The only thing I want to figure out is how I can enter some code that I can determine my own keywords, rather than let it pull the title (which isn’t showing up anyway). So do I make another page called keywords then fill it in or what? I almost have this, thanks. www.ozonhair.com
|
|
|
Need help…..I can’t get unique meta tags to work on each of my pages. I am using the following code. Based on this post http://www.bestrank.com/blog/making-your-shopify-site-seo-friendly-141/#comment-1243 it should work. Any help? please…..thank you. {% case page_title %} {% case template %}
|
|
|
whose site is that you link to? that page says ”we came up with a relatively simple way to include custom tags on your Shopify site” more like ”we grabbed this code from right here (see above), mangled it because we don’t understand it, and then posted it on our site as ours.” — Last edited 05:38PM, Sep 18, 2008 |
|
|
Usually, those who claim they are SEO specialists know shit about HTML. (And if I dare say, have very relaxed ethics in general…) It is imperative that these folks know about HTML because search engines read HTML. That is ludicrous (from ‘the’ site): You want to place the code between the head tag and body tag on the theme.liquid page. More like between the opening and closing tags of the head element. In his response to Christina he states that: Also, all of the conditionals that we worked with were placed on the “theme.liquid” page as opposed to altering each individual template page. Christina never said you have to alter template pages. Why would she use a conditional on the type of template if she did not place her code in theme.liquid? The blind leading the blind. People who want to ride the wave of ecommerce, but who are not computer-savvy, become SEO specialists, quite often. They remind me of chiropracters (although like chiropracters there are probably a few good ones out there): “Give me a couple of thousands dollars (or hundreds) and you will feel less pain. Of course, it’s not for tomorrow, it will take 3-4 months, maybe more time…” Etc. ---
http://wiki.shopify.com/Eleven_heavens Shopify Theme Work mllegeorgesand AT gmail DOT com — Last edited 08:10PM, Sep 18, 2008 |
|
|
Repeat. Bad Internet connection. ---
http://wiki.shopify.com/Eleven_heavens Shopify Theme Work mllegeorgesand AT gmail DOT com — Last edited 07:51PM, Sep 18, 2008 |
|
|
John Stevesone is a spammer. Please ban these people… ---
http://wiki.shopify.com/Eleven_heavens Shopify Theme Work mllegeorgesand AT gmail DOT com
|
|
|
he is gone ;-) The suggestions in this thread are good. We also have a little feature on our roadmap that will allow people to enter per page meta tag overrides and page title overrides. This should be part of a deployment this summer. ---
Tobias Lütke
|
|
|
@Tobi please please please! That would be great!
|
|
|
Does anyone know how to make this more dynamic? So if it is on a collection page it will display the tags for that page or if it is on the product page it will display the tags for that page. Maybe there is a universal tag command I can put in the content section and it will pick up whatever tags are associated with the page and turn them into keywords. Thanks. fom
|
mhromney75
Member
07:15PM, May 02, 2008