Jump to content

meta name = description problems


jrnetwork

Recommended Posts

I've implemented the following code into my portal template file 'header.tpl' as per the wiki file on SEO, but it is not displayed in the source code.

 

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} -

{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}

{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} -

{$kbarticle.article|truncate:100} - {/if}{if $announcement.title}{$announcement.title}

- {$announcement.text|truncate:100} - {/if}" />

 

If you look at this page: http://www.cubewebsolutions.com.au/support/announcements/2/Follow-our-support-team-on-twitter.html

 

and view the source code, you'll see this: <meta name="description" content="" />

 

Is there something I'm doing wrong... look forward to any advice.

Link to comment
Share on other sites

Okay I tried that... but not sure I got it right, so I reverted back.

 

These are my two sections of code:

 

Page Title:

 

<title>{$pagetitle}{if $kbcat.name} - {$kbcat.name}{/if}

{if $title} - {$title}{/if}

{if $kbarticle.title} - {$kbarticle.title}{/if}

{if $dlarticle.title}{$dlarticle.title} - {$dlcat.name}{/if}

{if $announcement.title} - {$announcement.title}{/if}{$announcement.text|truncate:200:"..."} - {$companyname}</title>

 

Meta Description changes:

 

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} -

{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}

{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} -

{$kbarticle.article|truncate:100} - {/if}{if $announcement.title}{$announcement.title}

- {$announcement.text|truncate:100} - {/if}" />

 

So what exactly are you saying the Meta Description code should be?

Link to comment
Share on other sites

Why not just say... Can you do it for me!!

 

<title>{$pagetitle}{if $kbcat.name} - {$kbcat.name}{/if}{if $title} - {$title}{/if}{if $kbarticle.title} - {$kbarticle.title}{/if}{if $dlarticle.title}{$dlarticle.title} - {$dlcat.name}{/if} - {$companyname</title>

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} - 
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} - 
{$kbarticle.article|truncate:100} - {/if}{if $title}{$title} - {$text|truncate:100}{/if}" />

Link to comment
Share on other sites

Hey sparky,

 

I do appreciate your help. It's good to learn all of this, and I usually read a lot and tinker around before I ask questions. Normally I come here to read and learn, and then if I'm stuck I ask, thinking that others have probably got stuck and solved it in a similar fashion.

 

I tried your code below for the meta description field, on this page. You'll see in the code I've commented the areas for easier viewing.

 

I replaced my code:

 

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} - 
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} - 
{$kbarticle.article|truncate:100} - {/if}{if $announcement.title}{$announcement.title}
- {$announcement.text|truncate:100} - {/if}" />

 

With your code:

 

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} -
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} -
{$kbarticle.article|truncate:100} - {/if}{if $title}{$title} - {$text|truncate:100} - {/if}" />

 

 

And and example is on this page:

 

http://www.cubewebsolutions.com.au/support/announcements/2/Follow-our-support-team-on-twitter.html

 

As you will see, the title tag is working fine (your change by removing a line did not seem to have an impact):

 

<title>Announcements - Follow our support team on twitter | Cube Web Solutions</title>

 

The meta description has this in the source code:

 

<meta name="description" content="Follow our support team on twitter - <p>Cube Web Solutions Support have now started to use twitter. Look out for our announcements and... - " />

 

Obviously I need to tweak it so the article title is not replicated in the description, as it's already in the page title. In Google it would look like this at present:

 

Announcements - Follow our support team on twitter | Cube Web Sol...

Follow our support team on twitter - <p>Cube Web Solutions Support have now started to use twitter. Look out for our announcements and...

 

I notice it's also putting the html paragraph tag there, so I assume this coding is pulling in the html code. I'm thinking this can't be changed?

 

Also, if I go right down to one of my Knowledgebase articles:

 

http://www.cubewebsolutions.com.au/support/knowledgebase/1/How-to-pay-your-invoice-from-Cube-Web-Solutions.html

 

And look at the source code this is what it shows:

 

<meta name="description" content=" - - How to pay your invoice from Cube Web Solutions -

- " />

 

It does not actually pull in any of the text from the page, only the knowledgbase article title again.

 

Sorry to be a pain. I do appreciate any further help you can offer when you have the time.

Link to comment
Share on other sites

Thats easy fixed to remove the paragraph tag... just use a modifier on the variable like this

{if $title}{$title} - {$text|truncate:100|strip_tags}{/if}

 

With the line, you must have been too quick to copy it as I edited it after I posted to remove it.

Take another look at the end of the title part from my post there to what you just posted.

Link to comment
Share on other sites

There was another there as well actually

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} - 
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description|strip_tags}{/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description|strip_tags} - {$kbarticle.title} - 
{$kbarticle.article|truncate:100|strip_tags}{/if}{if $title}{$title} - {$text|truncate:100|strip_tags}{/if}" />

You may want to add in a normal description as well for when the page is not an acticle, dl, or kb

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} - 
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description|strip_tags}{/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description|strip_tags} - {$kbarticle.title} - 
{$kbarticle.article|truncate:100|strip_tags}{/if}{if $title}{$title} - {$text|truncate:100|strip_tags}{/if}
{if $filename neq 'downloads' or $filename neq 'knowledgebase' or $filename neq 'announcements'}PUT YOU DESCRIPTION HERE{/if}" />

Edited by sparky
Link to comment
Share on other sites

I just saw the change, the forum page had not updated so I had to manually refresh.

 

The <p> tag etc is now removed, so it just seems like the one thing left.

 

Also, if I go right down to one of my Knowledgebase articles:

 

http://www.cubewebsolutions.com.au/support/knowledgebase/1/How-to-pay-your-invoice-from-Cube-Web-Solutions.html

 

And look at the source code this is what it shows:

 

<meta name="description" content=" - - How to pay your invoice from Cube Web Solutions -

- " />

 

It does not actually pull in any of the text from the page, only the knowledgbase article title again, and it's leaving all the redundant dashes there.

Link to comment
Share on other sites

I've just put that code in and replaced the three sections I had in there. I've just gone to this page:

 

http://www.cubewebsolutions.com.au/support/knowledgebase/1/How-to-pay-your-invoice-from-Cube-Web-Solutions.html

 

And this is the source code output:

 

<!--Start Title & Meta Changes--> 
  <title>Knowledgebase - How to pay your invoice from Cube Web Solutions | Cube Web Solutions</title> 
  <meta name="description" content="Knowledgebase -  -  - How to pay your invoice from Cube Web Solutions - " /> 
  <meta name="keywords" content="Knowledgebase, How to pay your invoice from Cube Web Solutions" /> 
<!--End Title & Meta Changes--> 

 

So in the description field, the I don't think the category name needs to be there, as it's already in the page title. If you can imagine this page showing up in Google's search results, as the moment, it would look like this:

 

Knowledgebase - How to pay your invoice from Cube Web Solutions | Cube Web Solutions (which is truncated to 68 characters for google and more for you yahoo)

Knowledgebase - - - How to pay your invoice from Cube Web Solutions -

 

Here is an interesting viewpoint. Is it relevant to show the category name in the page title at all? A cleaner look for Google Search results would be:

 

How to pay your invoice from Cube Web Solutions | Cube Web Solutions

 

Which eliminates the category name from the front (knowledgebase, download or announcment)

 

Then, as far as the meta description goes, is it possible to show some of the text from the actual article itself, which is set to be truncated like you did before.

 

Therefore this page:

 

http://www.cubewebsolutions.com.au/support/knowledgebase/1/How-to-pay-your-invoice-from-Cube-Web-Solutions.html

 

Would show up in Google like this:

 

How to pay your invoice from Cube Web Solutions | Cube Web Solutions

You can pay your Cube Web Solutions invoice via the following methods

 

Does that make sense? It would be great if it was like that, and not showing all the extra "- - -" signs in it.

 

Finally, can you give me your paypal account, as I should be throwing something your way for all of your hard work.

Link to comment
Share on other sites

I assumed you meant one of these pages. Interesting that one has to register to read the pre-sales questions?

 

http://tshosting.com.au/knowledgebase/8/Are-there-any-account-setup-fees-for-hosting.html

 

I looked at the source code:

 

<title>Knowledgebase » Pre-Sales Questions - TsHosting and Web Design</title>

<meta name="description" content="Knowledgebase » Pre-Sales Questions" />

<meta name="keywords" content="Knowledgebase" />

 

The description is better in that it does not have the unnecessary dashes (- - etc) in it, but it does have the » in there. But my point was there is no point repeating the same info from the title section in the description section, minus the company name.

 

So back to my original question, is it possible to have the outcome like this:

 

<title>Section name - Article Name - Company Name</title>

 

<meta name="description" content="First part of the text from the page and have that truncated" />

 

<meta name="keywords" content="the way you currently have it" />

 

so, using the example of my page: http://www.cubewebsolutions.com.au/support/knowledgebase/2/DNS-settings.html

 

If this showed up in Google Search Results, it would be in this format:

 

Knowledgebase - DNS settings - Cube Web Solutions

Once your webhosting environment has been set up, and your domain is registered, you will need to delegate your domain name to our Name Servers servers...

 

which is:

 

Section - Article - Company

First part of text on the page, truncated.

 

I'm trying to make that very clear :)

Link to comment
Share on other sites

I assumed you meant one of these pages. Interesting that one has to register to read the pre-sales questions?

Thanks for pointing that out... somehow they were marked as private and is now fixed.

So back to my original question, is it possible to have the outcome like this:

 

<title>Section name - Article Name - Company Name</title>

 

<meta name="description" content="First part of the text from the page and have that truncated" />

 

<meta name="keywords" content="the way you currently have it" />

Yes it can be like you asked. I needed to do some DB queries to get the correct items to work correctly. I won't be posting the code here though.

Link to comment
Share on other sites

Yeah, I knew you wouldn't be posting the code here just for everyone to see. That's why I've sent you 2 PM's via the in-built forum messaging system. Does their system not work?

 

Both of my pm's I offered to pay you, as well as post #13 in the thread http://forum.whmcs.com/showthread.php?t=36631

 

So again, I have appreciated your assistance so far. You said that what I asked for was possible... so again, where do we go from here :)

Link to comment
Share on other sites

Let me make this very clear to you again

I HAVE NOT RECIEVED ANY PM'S FROM YOU. My pm box is empty.

 

Also have a read here http://forum.whmcs.com/faq.php

particually this part

No advertising, offers or self promotion is allowed, except in the "Commercial Modules & Addons" section where only offers of addons and modules are permissible.

You have probably lost your PM priviledges for apparently making an offer... Maybe you should ask a moderator about that.

 

Answer to your question: WE don't go anywhere from here.

You were given the idea of what to do and how to do it.

You just need to get the correct variables to apply it.

 

Discussion CLOSED

Link to comment
Share on other sites

C'mon Guys - calm down. No need to get out of hand ;-)

 

But yes Jason, Sparky is right in saying and promoting 'No advertising, offers or self promotion is allowed, except in the "Commercial Modules & Addons" section where only offers of addons and modules are permissible. '

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated