Page 1 of 1

Meta Tags Not Working

Posted: Mon Oct 13, 2014 2:56 pm
by earcandy
I have placed this in my page specific data:

<meta name="language" content="en-CA" />
<meta name="description" content="online law degree from California School of Law online law school"/>
<meta name="title" content="California School of Law Online Law School"/>
<meta name="keywords" content="online law school,online law schools,law school online"/>
<meta name="google-site-verification" content="5snNNreV_msr2-VsIKyql9UWyA5cvs01jjkSdbgB-mA" />

There is no global meta setup at all.

Metamax is installed but no options are enabled. We were told removing metamax could break our site.

However Google still sees the page title as :Home :: California School of Law

Why is my page specific metadata not taking effect?

Re: Meta Tags Not Working

Posted: Mon Oct 13, 2014 3:09 pm
by velden
{metadata} needs to be used in template probably.

Re: Meta Tags Not Working

Posted: Mon Oct 13, 2014 5:22 pm
by earcandy
So after adding [metadata} to the tamplate can I safely remove the {metamax} tag?

Here is my template:

{MetaMax}
{metadata}
{process_pagedata}
{mobile}{capture assign='mobiletemp'}{$mobile_detect}{/capture}
{capture assign='normal_content'}{content}{/capture}
{capture assign="mobilecontent"}{content block="mobile-content" wysiwyg="false"}{/capture}
{capture assign="sidebar"}{content block="sidebar"}{/capture}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta name="google-site-verification" content="DPXyJz1lXcazRUBSAs6bkaXyoK5cqrFGUVltC8Zu0MI" />
<title>{if $page_name !='home'}{title} - {/if}{sitename}</title>
{*If the device is mobile load the mobile CSS and Jquery files*}
{if $mobiletemp}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{root_url}/mobile/css/themes/default/jquery.mobile-1.3.0.css" />
<link rel="stylesheet" href="{root_url}/mobile/docs/_assets/css/jqm-docs.css" />
<link href="{root_url}/mobile/photoswipe/photoswipe.css" type="text/css" rel="stylesheet" />
<__script__ src="{root_url}/mobile/js/jquery.js"></__script>
<__script__ src="{root_url}/mobile/docs/_assets/js/jqm-docs.js"></__script>
<__script__ src="{root_url}/mobile/js/jquery.mobile-1.3.0.js"></__script>
<__script__ type="text/javascript" src="{root_url}/mobile/photoswipe/lib/klass.min.js"></__script>
<__script__ type="text/javascript" src="{root_url}/mobile/photoswipe/code.photoswipe-3.0.5.min.js"></__script>
{literal}
<__script__ type="text/javascript">
$(document).bind('mobileinit',function(){
$.mobile.page.prototype.options.keepNative = "select, input, textarea.bar";
$.mobile.ajaxEnabled = false;
});
(function(window, $, PhotoSwipe){

$(document).ready(function(){

$('div.gallery-page')
.live('pageshow', function(e){

var
currentPage = $(e.target),
options = {},
photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options, currentPage.attr('id'));

return true;

})

.live('pagehide', function(e){

var
currentPage = $(e.target),
photoSwipeInstance = PhotoSwipe.getInstance(currentPage.attr('id'));

if (typeof photoSwipeInstance != "undefined" && photoSwipeInstance != null) {
PhotoSwipe.detatch(photoSwipeInstance);
}

return true;

});

});

}(window, window.jQuery, window.Code.PhotoSwipe));

</__script>
{/literal}

{*If not load the normal Browser CSS and Jquery files*}
{else}
{metadata}
<link rel="stylesheet" href="{root_url}/css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="{root_url}/css/grid.css" type="text/css" media="all">
{cms_stylesheet}
<__script__ type="text/javascript" src="{root_url}/js/maxheight.js"></__script>
<!--[if lt IE 7]><__script__ type="text/javascript" src="http://info.template-help.com/files/ie6 ... ![endif]-->
<!--[if lt IE 9]><__script__ type="text/javascript" src="{root_url}/js/html5.js"></__script><![endif]-->
{get_root_page_alias assign="root_page_alias"}
{/if}

<__script__ type="text/javascript">
//<![CDATA[
(function() {
var shr = document.createElement('script');
shr.setAttribute('data-cfasync', 'false');
shr.src = '//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js';
shr.type = 'text/javascript'; shr.async = 'true';
shr.onload = shr.onreadystatechange = function() {
var rs = this.readyState;
if (rs && rs != 'complete' && rs != 'loaded') return;
var site_id = '269e6241d89e7ff52c29dbdaf82db087';
try { Shareaholic.init(site_id); } catch (e) {}
};
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(shr, s);
})();
//]]>
</__script>
</head>
</__body>
{if $mobiletemp}


</__body>
{if $page_name =='home'}
<div data-role="page" data-position="fixed" data-theme="b" id="jqm-home" class="type-home">
<div id="jqm-homeheader">
<h1 id="jqm-logo" style="text-align:center"><img src="{root_url}/uploads/images/logo-mobile.jpg" alt="Online law school" /></h1>
</div>
<div data-role="content">
{*This is the mobile menu, you can use the the params excludeprefix="" here to ommit certain pages on the mobile version*}
{menu template="cmsms : cmsms-mobile" excludeprefix="home"}
{else}
<div data-role="page" class="type-interior">
<div data-role="header" data-theme="b"><a href="{root_url}" data-icon="home" data-iconpos="left" data-direction="reverse" class="ui-btn-left jqm-home">Home</a>
<h1>{title}</h1>
</div>
<div data-role="content">
{/if}
{*If the Mobile content is empty we show the normal content*}
{if !empty($mobilecontent)}
{$mobilecontent}
{else}
{$normal_content}
{/if}
</div><!-- /content -->
<div data-role="footer" class="footer-docs" data-theme="c">
{global_content name='footer-mobile'}
{*you can use a specific global content block to display a different footer on the mobile version*}
</div>
</div><!-- /page -->
{*If the device is a normal browser the following markup will be used*}
{else}
{global_content name='header'}
<section id="content">
{if $page_name =='home'}
{global_content name='homepage'}
{/if}
<div class="container_12">
<div class="inside1">
<div class="container">
{if $page_name !='home'}
<h2>{title}</h2>
{/if}
{if !empty($sidebar)}
<div class="grid_9 alpha">
{$normal_content}
</div>
<div class="grid_3 omega">
{$sidebar}
</div>
{else}
{$normal_content}
{/if}
</div>
</div>
</div>
</section>
{global_content name='footer'}
{/if}
{global_content name="analytics"}
<__body>
{capture}{content block="Online Law School at The California School of Law" oneline="true"}{/capture}
</__html>

Re: Meta Tags Not Working

Posted: Mon Oct 13, 2014 7:04 pm
by Jo Morg
earcandy wrote:So after adding [metadata} to the tamplate can I safely remove the {metamax} tag?
Nope. One is not normaly interchangeable with the other. It seems that the {metamax} tag should be responsible by the whole < head > < /head > section which {metadata} is not meant to do.
There are a few errors on your template, but mostly it seems that {metamax} may not be properly configured.
At this point I would remove {metadata} as it is doing more harm than good.
earcandy wrote:Metamax is installed but no options are enabled. We were told removing metamax could break our site.
Metamax should be configured with some options. Removing it will break the site unless you know what the tag is meant to do and you know how to do it without it.

PS: After finding and visiting the site and re-reading your template I need to point this out:
  1. {process_pagedata} should be at the top of the template;
  2. {MetaMax} or {metadata} should be somewhere insde the Head section of the html (one or the other, not both);
  3. apparently you have {metadata} twice on the template and the second one should be the correct one;
  4. So I would remove the 1st two tags {MetaMax} and {metadata};
HTH

Re: Meta Tags Not Working

Posted: Tue Oct 14, 2014 1:03 am
by rotezecke
unrelated, but i believe assigning vars:

Code: Select all

{capture assign='normal_content'}{content}{/capture}
is better done like:

Code: Select all

{content assign='normal_content'}
(better performance)