• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Mon Aug 20, 2012 9:36 pm 
Offline
New Member

Joined: Mon Aug 20, 2012 9:28 pm
Posts: 3
Приветсвую всех,
Достался сайт с ошибкой выскакивающей в верху экрана:

string(114) "Smarty error: [in tpl_head:26 line 18]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 590)"

Пытался устранить проблему бурав строки кода в {literal}{/literal}
не помогло.

Подскажите где копать? И можно это вообще устранить?


Top
 Profile  
 
 Post subject: Re: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Tue Aug 21, 2012 8:56 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Apr 26, 2012 8:38 pm
Posts: 404
Location: Ramenskoe
Приведите текст шаблона для той страницы, на которой выскакивает ошибка.


Top
 Profile  
 
 Post subject: Re: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Tue Aug 21, 2012 5:45 pm 
Offline
New Member

Joined: Mon Aug 20, 2012 9:28 pm
Posts: 3
Вот шаблон на который указывает ошибка:


Code:
<?php /* Smarty version 2.6.25, created on 2012-08-21 21:30:50
         compiled from tpl_head:26 */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'metadata', 'tpl_head:26', 2, false),array('function', 'stylesheet', 'tpl_head:26', 5, false),array('function', 'global_content', 'tpl_head:26', 10, false),array('function', 'title', 'tpl_head:26', 11, false),)), $this); ?>
<?php $this->_cache_serials['/home/artmac/public_html/tmp/templates_c/%%1E^1E2^1E2485B3%%tpl_head%3A26.inc'] = 'c1720e241a81d207c83ab86018a79261'; ?><head>

<?php if ($this->caching && !$this->_cache_including): echo '{nocache:c1720e241a81d207c83ab86018a79261#0}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('c1720e241a81d207c83ab86018a79261','0');echo smarty_cms_function_metadata(array(), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:c1720e241a81d207c83ab86018a79261#0}'; endif;?>


   <link type="text/css" rel="stylesheet" href="/css/fontface.css" />

   <link type="text/css" rel="stylesheet" href="/cssreset.css" />

   <?php if ($this->caching && !$this->_cache_including): echo '{nocache:c1720e241a81d207c83ab86018a79261#1}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('c1720e241a81d207c83ab86018a79261','1');echo smarty_cms_function_stylesheet(array(), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:c1720e241a81d207c83ab86018a79261#1}'; endif;?>




   <script type="text/javascript" src="http://yandex.st/jquery/1.4.2/jquery.min.js"></script>

   <script type="text/javascript" src="/js/sitescripts.js"></script>



<?php if ($this->caching && !$this->_cache_including): echo '{nocache:c1720e241a81d207c83ab86018a79261#2}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('c1720e241a81d207c83ab86018a79261','2');echo smarty_cms_function_global_content(array('name' => 'Для интернет эксплорера'), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:c1720e241a81d207c83ab86018a79261#2}'; endif;?>


   <title><?php if ($this->caching && !$this->_cache_including): echo '{nocache:c1720e241a81d207c83ab86018a79261#3}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('c1720e241a81d207c83ab86018a79261','3');echo smarty_cms_function_title(array(), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:c1720e241a81d207c83ab86018a79261#3}'; endif;?>
</title>

<script type="text/javascript">



  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-27192519-1']);

  _gaq.push(['_trackPageview']);



  (function() )();



</script>

</head>


Top
 Profile  
 
 Post subject: Re: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Tue Aug 21, 2012 7:03 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Nov 01, 2007 3:11 pm
Posts: 337
В основном шаблоне, тело яваскрипта (или полностью) нужно заключить в {literal},
например:
Code:
<script type="text/javascript">
{literal}
function a(){
...
}
{/literal}
</script>


Top
 Profile  
 
 Post subject: Re: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Tue Aug 21, 2012 8:06 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Apr 26, 2012 8:38 pm
Posts: 404
Location: Ramenskoe
Приведенный текст не является Smarty шаблоном. И если у вас действительно это находится в шаблоне, то код заключенный в теги <?php ... ?> у вас просто не работает, т. к. для Smarty обработчика это всего лишь текст и не как не php скрипт.
На всякий случай напишу.
Code:
Чтобы посмотреть основной шаблон зайдите в административную часть вашего сайта, далее в верхнем меню "Оформление" => "Шаблоны" в появившемся списке нажмите на шаблон, который требуется. Вы увидите текст глобального шаблона.
Именно он меня интересует.


Top
 Profile  
 
 Post subject: Re: Ошибка syntax error: unrecognized tag 'var'
PostPosted: Wed Aug 22, 2012 6:59 am 
Offline
New Member

Joined: Mon Aug 20, 2012 9:28 pm
Posts: 3
Спасибо большое von-hamster, guro
Я понял, что пытался вставить {literal} не в том шаблоне, поэтому не было эффекта. Ошибка исчезла.

тема закрыта.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner