jrnetwork Posted March 12, 2011 Share Posted March 12, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 12, 2011 Share Posted March 12, 2011 $announcements is an array of all of the announcements {$announcement.title} is one record from $announcements To access it you need to know what the array id is eg.. {$announcements.0.title} 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 12, 2011 Author Share Posted March 12, 2011 How does on find that, and how does that impact the other parameters in the script in my first post i.e. the download articles an the knowledgebase articles. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 12, 2011 Share Posted March 12, 2011 try using {$title} 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 12, 2011 Author Share Posted March 12, 2011 In what way, sorry to sound stupid. What would be the correct meta description script to use? I would have thought he one in the wiki would be correct? is that out of date? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 12, 2011 Share Posted March 12, 2011 Take a look in your header.tpl at the <title> tag same as that but {if $announcement.title}{$announcement.title} - {$announcement.text|truncate:100} - {/if} can be removed from both. {if $title}{$title}{/if} 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 12, 2011 Author Share Posted March 12, 2011 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? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 12, 2011 Share Posted March 12, 2011 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}" /> 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 13, 2011 Author Share Posted March 13, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 13, 2011 Share Posted March 13, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 13, 2011 Share Posted March 13, 2011 (edited) 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 March 13, 2011 by sparky 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 13, 2011 Author Share Posted March 13, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 13, 2011 Author Share Posted March 13, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 13, 2011 Share Posted March 13, 2011 I tested it myself... and am fixing it now along with a few other features. Ignore my last post as there is quite a few errors in it... some vars are from early versions of whmcs. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 13, 2011 Share Posted March 13, 2011 Jason, take a look at my site to see how it is now... link below 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 13, 2011 Author Share Posted March 13, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 13, 2011 Share Posted March 13, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 13, 2011 Author Share Posted March 13, 2011 so what do we need to do next? 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 14, 2011 Author Share Posted March 14, 2011 So Sparky, where do we go from here? I also pm'd you too. 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 16, 2011 Author Share Posted March 16, 2011 Hey Sparky, you've gone very quiet? I have offered to pay you for your work... 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 16, 2011 Share Posted March 16, 2011 You haven't offered... besides that, it is not allowed here. And I also have not recieved a PM from you. Have been quite busy and have already said "I won't be posting the code here" 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 16, 2011 Author Share Posted March 16, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 16, 2011 Share Posted March 16, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
jrnetwork Posted March 16, 2011 Author Share Posted March 16, 2011 Gee, aren't we a friendly type. Brings new meaning to the word 'community'. I'll go where you kindly suggested and pay someone a tad more professional for their time! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Guy Posted March 16, 2011 Share Posted March 16, 2011 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. ' 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.