Page 1 of 1

Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 8:42 am
by suadmin
Hi,

I wish to keep canonical tag on my website but my template instead of updating does not get submitted.

tag i am using:

<link rel="canonical" href="{if isset($canonical)}{$canonical}{else}{$content_obj->GetURL()}{/if}" />

i have used this tag in my other websites where it worked fine for me. Please advice what might be a problem.

Regards,
Anisha

Re: Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 9:15 am
by Rolf
Can you please post the whole template?

Re: Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 10:44 am
by suadmin
Hi,

Following is my template.

Please help asap.

Thanks.
Anisha

------------------------------------------------
My template
------------------------------------------------

{process_pagedata}
<!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">
<head>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{metadata}
{cms_stylesheet}
<!--[if IE 7]>
<link href="css/ie7.css" rel="stylesheet" type="text/css" type="text/css" media="screen" />
<![endif]-->
{literal}
<__script__ type="text/javascript" src="js/jquery-1.7.min.js"></__script>
<__script__ type="text/javascript" src="js/tms-0.js"></__script>
<__script__ type="text/javascript" src="js/tms-0.4.1.js"></__script>
<__script__ type="text/javascript" src="js/jcarousellite.js"></__script>
<__script__ type="text/javascript" src="js/jquery.js"></__script>
<__script__ type="text/javascript">
$(document).ready(function(){
$('.slider')._TMS({
show:0,
pauseOnHover:false,
prevBu:false,
nextBu:false,
playBu:false,
duration:3000,
preset:'diagonalFade',
pagination:false,//'.pagination',true,
pagNums:false,
slideshow:7000,
numStatus:false,
banners:false,// fromLeft, fromRight, fromTop, fromBottom
waitBannerAnimation:false,
progressBar:false
})
$().UItoTop({ easingType: 'easeOutQuart' });
})
$(function() {
$(".carousel_box").jCarouselLite({
btnNext: ".next1",
visible: 2,
easing: 'swing',
speed: 600
});
$(".carousel_box1").jCarouselLite({
btnNext: ".next2",
btnPrev: ".prev2",
visible: 6,
easing: 'swing',
speed: 1000
});
$(".carousel_box2").jCarouselLite({
btnNext: ".next3",
btnPrev: ".prev3",
visible: 6,
easing: 'easeInOutBack',
speed: 1000
});
$(".gray_content").jCarouselLite({
btnNext: "#next",
btnPrev: "#prev",
visible: 1,
easing: 'swing',
speed: 800
});
});
</__script>
{/literal}


</head>

</__body>

<div id="wrapper1">

<div id="banner"><div>

<!-- slider -->
<div id="slider">
<div style="overflow: hidden;" class="slider">
<ul class="items">
<li style="display:none;">{cms_module module='ImagePicker' name='Inner Banner'}</li>
</ul>
</div>
</div>
<!-- slider-end -->

</div></div>

<!-- Mainpage End -->
<div id="mainpage">

<div id="main">
<!-- Header Start -->
{global_content name='header'}
<!-- Header End -->

<!-- Blank Start -->
<div class="blank1"></div>
<!-- Blank End -->

<div class="clear"></div>

<!-- Container Start -->
<div id="container">
<div class="inner-main">

<!-- Col Left Start -->
{global_content name='left'}
<!-- Col Left End -->

<!-- Col Right Start -->
<div id="col-right">

<!-- Bread Crumb Start -->
<div class="breadcrumb">
<ul class="horz-link">
<li><a href="index.php">Home</a></li>
<li class="act">{breadcrumbs delimiter=""}</li>
</ul>
</div>
<!-- Bread Crumb Start -->

<h1>{title}</h1>
{content}
</div>
<!-- Col right End -->

</div>
</div>
<!-- Container End -->

</div>

<div class="clear"></div>

<!-- Footer Start -->
<div id="footer-b">
<div class="footer">

<!-- Footer Main Start -->
{global_content name='footer'}
<!-- Footer Main End -->

</div>
</div>
<!-- Footer End -->

</div>

<!-- Mainpage Start -->

</div>
</div>
{literal}
//google analytics
{/literal}
<__body>
</__html>

Re: Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 11:25 am
by velden
Works for me.

If possible read the error log of apache. I suspect it has something to do with mod_security. If so, probably your hosting provider is the one that can solve this issue.

Re: Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 1:05 pm
by Rolf
Beside the fact you having two jQuery calls in the template, I dont see anything special...

Re: Not able to add canonical tag in existing template

Posted: Thu May 30, 2013 3:59 pm
by Dr.CSS
This is the default call in the NcleanBlue template/theme...

{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}