TARJr Posted February 6, 2010 Share Posted February 6, 2010 Is there a way I can have unique Meta Description and Keywords tags in my Header.tpl file for each page? So my homepage.tpl will be different from my contact.tpl, etc. and knowledgebase articles can have there own descriptions... Thanks, 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted February 6, 2010 Share Posted February 6, 2010 You can realize this using the if-statement of smarty: <META NAME="KEYWORDS" CONTENT="{if $filename eq "index"}keyword,for,index{elseif $filename eq "contact"}keyword,for,contact{/if}" /> 0 Quote Link to comment Share on other sites More sharing options...
jumbiehost Posted September 29, 2011 Share Posted September 29, 2011 THANK YOU! That helps a bunch! Note for everyone else.. Code can be altered and applied to just about anything! 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 5, 2012 Share Posted January 5, 2012 this is great worked well ! But ideally i would want to use a variable like $metakeyword and put each set of meta keywords in the language file. I would do the same for titles and descriptions. Does anyone know how to do this? I tried to setup the variable in the php file and then in the header.tpl but its not working. Is there something missing in whmcs ? perhaps a PHP class? Anyone have any ideas? thanks 0 Quote Link to comment Share on other sites More sharing options...
Sitepearl Posted January 5, 2012 Share Posted January 5, 2012 What would be REALLY cool is if Knowledgebase articles had native meta inputs :] Exactly what page are you trying to put the metatags on? I can probably help you. 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 5, 2012 Share Posted January 5, 2012 What would be REALLY cool is if Knowledgebase articles had native meta inputs Agrred! whmcs needs to be extended more to have cms features like that. Exactly what page are you trying to put the metatags on? I can probably help you. thanks for offer to help! appreciated. Manyl pages really, were building the whole site based on the new default theme in V5 and making use of Boostrap css. Dont want to maintain 2 sites and 2 templates anymore (Joomla and whmcs). So need a way to add unique meta tags per page. 0 Quote Link to comment Share on other sites More sharing options...
Sitepearl Posted January 6, 2012 Share Posted January 6, 2012 Aha that's exactly what we did with ours - we actually built a WHMCS theme based on our Joomla theme: http://www.sitepearl.com If I were to put a meta tag on each custom page (IE: Pages I can edit the PHP source for), I would just create a smarty variable within the PHP file (or a language file), and then access that via {$keywords}, {$description} in the header.tpl file... and maybe add a check to disable it on pages that don't require that meta data (cart.php, etc). 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 6, 2012 Share Posted January 6, 2012 Hi Sitepearl. Actually were not building a theme based on Joomla. Were moving the whole site to whmcs. So we dont have to use 2 systems. Anyhow, yes i tried to do as you say with smarty variable, that would be the easiest way but its not working. I believe something is missing, perhaps a php class or other. We need to so it exactly like the page titles by adding the variables in the php files and calling them in the header.tpl. 0 Quote Link to comment Share on other sites More sharing options...
Sitepearl Posted January 6, 2012 Share Posted January 6, 2012 I think you misunderstood - we used to use Joomla/WHMCS, but then we converted our Joomla theme to WHMCS so we didn't have to use two systems. In your custompage.php file, you should have something like this: <?php $smarty->assign("description", "Our company profile"); ?> Then in your header.tpl file, you should be able to do: {$description} 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 6, 2012 Share Posted January 6, 2012 I think you misunderstood - we used to use Joomla/WHMCS, but then we converted our Joomla theme to WHMCS so we didn't have to use two systems. In your custompage.php file, you should have something like this: <?php $smarty->assign("description", "Our company profile"); ?> Then in your header.tpl file, you should be able to do: {$description} Ok i see, looked at your site looks good all whmcs. Yes that code looks right, i was reading the docs on smarty and thats what we need is to assign a smarty variable. http://www.smarty.net/docsv2/en/language.variables.tpl <?php $smarty = new Smarty(); $smarty->assign('firstname', 'Doug'); $smarty->assign('lastname', 'Evans'); $smarty->assign('meetingPlace', 'New York'); $smarty->display('index.tpl'); ?> thanks! i will work on this tonight and report back. 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 7, 2012 Share Posted January 7, 2012 I have been unsuccessful with any smarty->assign. Its just not showing up in the page. Has anyone implemented this? What is in your php file? 0 Quote Link to comment Share on other sites More sharing options...
bluebirdnet Posted January 21, 2012 Share Posted January 21, 2012 (edited) Here is the best way i have found to have custom keywords or descriptions for each page by loading them from the language file! # This example shows for 2 pages index.php and hosting.php # In your header tpl add the following, # This checks to see which php page is loaded and then looks in the language file for the variables i have set. <meta name="keywords" content="{if $filename eq "index"}{$LANG.keywordsindex}{elseif $filename eq "hosting"}{$LANG.keywordshosting}{/if}" /> <meta name="description" content="{if $filename eq "index"}{$LANG.descriptionindex}{elseif $filename eq "hosting"}{$LANG.descriptionhosting}{/if}" /> # Then in your language file EG: english.php add the following $_LANG['keywordshosting'] = "keywords, for, hosting"; $_LANG['keywordsindex'] = "Keywords, for, index"; $_LANG['descriptionindex'] = "Description for index....."; $_LANG['descriptionhosting'] = "Description for hosting...."; Hope this helps you out! Edited January 21, 2012 by bluebirdnet forgot something 0 Quote Link to comment Share on other sites More sharing options...
tapnet Posted April 3, 2012 Share Posted April 3, 2012 I have 5 URLs that Google Webmaster tools has detected duplicate title tags and they are all root to the cart.php. /webhosting/cart.php /webhosting/cart.php?gid=11 /webhosting/cart.php?gid=12 /webhosting/cart.php?gid=18 /webhosting/cart.php?gid=19 Does anyone know how to get the Title+Meta customized so it doesn't appear as duplicate? 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted June 13, 2020 Share Posted June 13, 2020 On 4/3/2012 at 5:33 AM, tapnet said: I have 5 URLs that Google Webmaster tools has detected duplicate title tags and they are all root to the cart.php. /webhosting/cart.php /webhosting/cart.php?gid=11 /webhosting/cart.php?gid=12 /webhosting/cart.php?gid=18 /webhosting/cart.php?gid=19 Does anyone know how to get the Title+Meta customized so it doesn't appear as duplicate? Any solution for this issue? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 13, 2020 Share Posted June 13, 2020 perhaps the code in the thread below could be used or modified for that purpose... 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted June 14, 2020 Share Posted June 14, 2020 23 hours ago, isixhosting said: Any solution for this issue? Why bother with this when WHMCS is by design a duplicate content generator? All you get is laughable result. 0 Quote Link to comment Share on other sites More sharing options...
ctshuma Posted June 18, 2020 Share Posted June 18, 2020 hie guys i would like to add this script (<script src="//www.socialintents.com/api/chat/socialintents.1.3.js#2c9fa23c723a94a501723ce9efa402f4" async="async"></script>) for our livechat on our website for each web page. please help 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.