Not able to add canonical tag in existing template

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
suadmin
Forum Members
Forum Members
Posts: 36
Joined: Tue Jan 22, 2013 7:29 am

Not able to add canonical tag in existing template

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Not able to add canonical tag in existing template

Post by Rolf »

Can you please post the whole template?
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
suadmin
Forum Members
Forum Members
Posts: 36
Joined: Tue Jan 22, 2013 7:29 am

Re: Not able to add canonical tag in existing template

Post 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>
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Not able to add canonical tag in existing template

Post 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.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Not able to add canonical tag in existing template

Post by Rolf »

Beside the fact you having two jQuery calls in the template, I dont see anything special...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Not able to add canonical tag in existing template

Post 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}
Post Reply

Return to “The Lounge”