Page 1 of 1

Duplicate content block: content_en - content page error

Posted: Mon Mar 08, 2021 1:34 pm
by urubababumba
Hello, trying get back to life old 1.12.2 version.
I have a problem with content pages in background -Duplicate content block: content_en.
Image
Please, could you point me.

Thank you

Re: Duplicate content block: content_en - content page error

Posted: Mon Mar 08, 2021 3:32 pm
by DIGI3
Look in your page templates for {content} or {content block= ... } tags. There's a duplicate one somewhere. If you're using template inheritance you'll need to check in parent and child templates, as the default content block can only exist once.

Re: Duplicate content block: content_en - content page error

Posted: Mon Mar 08, 2021 9:56 pm
by urubababumba
Thank you,
I have both of them in template just once:

Code: Select all

  
      <div class="lavybox">
      {content} 
      {content block='dalsibox' assign='dalsibox'}
      {if !empty($dalsibox)}
      <br class="clear" />
      <div class="dalsibox">
       {$dalsibox} 
      </div>
and even if I remove one from template code I am not able to execute/save tamplate with same Duplicate content error.

Re: Duplicate content block: content_en - content page error

Posted: Mon Mar 08, 2021 10:16 pm
by DIGI3
Without seeing the whole template it's hard to tell. You could try copying parts of it at a time to a new template, and see if you can narrow down the cause. If you want to paste the full template you can, too.

Make sure to check any global content blocks or other included items.

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 8:00 am
by urubababumba
Hello, here is the main template code:

Code: Select all

{process_pagedata}{strip} 
{if !isset($get_title)}
 {title assign='get_title'}
{/if}
{/strip}<!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="sk" lang="sk">

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

<title>{$get_title} | {sitename}</title>

{metadata}

{cms_stylesheet}

<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

<link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light+Two&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

<link href='http://fonts.googleapis.com/css?family=Oswald&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

{cms_selflink dir="start" rellink=1}
{cms_selflink dir="prev" rellink=1}
{cms_selflink dir="next" rellink=1}


<!--[if IE 6]>
<__script__ type="text/javascript" src="modules/MenuManager/CSSMenu.js"></__script>
<![endif]-->
{* The above JavaScript is required for Menu - NCleanBlue-css to work in IE6 *}

{* the literal below and the /literal at the end are needed whenever there are {"curly brackets"} as smarty will think it's something to process and will throw an error *}
{* IE6 png fix *}
{literal}
<!--[if IE 6]>
<__script__ type="text/javascript"  src="uploads/NCleanBlue/js/ie6fix.js"></__script>
<__script__ type="text/javascript">
 // argument is a CSS selector
 DD_belatedPNG.fix('.sbar-top,.sbar-bottom,.main-top,.main-bottom,#version');
</__script>
<style type="text/css">
/* enable background image caching in IE6 */
html {filter:expression(document.execCommand("BackgroundImageCache", false, true));} 
</style>
<![endif]-->


{/literal}

{literal}

<__script__ src="http://code.jquery.com/jquery-latest.js"></__script>
<__script__ type="text/javascript">
  jQuery(document).ready(function($) {
    $(".scroll").click(function(event) {
    event.preventDefault();
    $('html,body').animate( { scrollTop:$(this.hash).offset().top } , 1000);
    } );
  } );
</__script>
{/literal}

</__script>

</head>

</__body id="short"> 
<link media="screen" type="text/css" href="{uploads_url}/template/js/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet">
<!-- TOP -->
<div id="top">


  <!-- Wrapper -->
  <div id="wrapper">
      
      <!-- hlavička --> 
      <div id="header">
  
        <!-- logo -->
        <div class="logo"> {cms_selflink dir="start" text="$sitename"}  </div>
        
        <div class="rychle-info">{global_content name='x_hlavicka_kontakt'}</div>
          
        <!-- navigacia -->
        <div class="menu">
        <h2 class="accessibility util-clearb">Navigácia</h2>
        <div class="page-menu util-clearfix">
        {menu loadprops=0 template='cssmenu_ulshadow.tpl'}
        </div>
        <hr class="accessibility util-clearb" />        
        </div>
        <div class="scroller">{global_content name='x_hlavicka_scroller'}</div>             
      </div> 

      <!-- hlavička end -->
     
      <!-- obsah -->         
      <div id="obsah">

      <!-- infobox -->  

     
      <div class="lavybox">
     
       {content} 
      
      {content block='dalsibox' assign='dalsibox'}
      {if !empty($dalsibox)}
      <br class="clear" />
      <div class="dalsibox">
       {$dalsibox} 
      </div>{/if}      
<!-- Zelena --> 
<div class="zelena2">

</div>
      <!-- zelena -->
      </div>
     <!-- prvyhomebox -->      
<div class="pravybox">      
<div class="download">  
</div>
       
<div class="informacie">
       <h2>Informácie</h2>
       <p>text</a></p> </div>

       <div class="sluzby">
       <h2>Naše služby</h2>
       <ul>

        <li class="menuactive"><a class="menuactive" href="link"><span>Link1</span></a>


</li>

<li><a href="link"><span>Link2</span></a>


</li>

</ul></div>
<p></br><img /></p>
      </div></div>
      <!-- homebox end --> 
      
            
  </div>  <!-- KONIEC OBSAH -->  

   
</div>   <!-- Wrapper center end -->      
    <div class="fullfooterone">
      <div class="footer">
      
          <div class="footerbox">
            {global_content name='x_footer_onas'}
          </div>
      
          <div class="footerbox">
            {global_content name='x_footer_kontakt'}
          </div>

          <div class="footerboxx">
            {global_content name='x_footer_formular'}
          </div>       
              <div class="footergdpr">{global_content name='x_footer_gdpr'}</div>
      </div>  <!-- footer -->
        
     </div>
     
     <div class="fullfootertwo">
      <div class="paticka">
      
       <div class="footecho"> {global_content name='x_footer'}</div> <div class="footmenu"> {menu loadprops=0 number_of_levels='1'} </div>   
      </div>  <!-- paticka -->
     </div>
       
       </div>
<a id="bottom"></a>
<__body>   
</__html>
and subpage template code:

Code: Select all

{process_pagedata}{strip} 
{if !isset($get_title)}
 {title assign='get_title'}
{/if}
{/strip}<!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="sk" lang="sk">

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

<title>{$get_title} | {sitename}</title>

{metadata}

{cms_stylesheet}

<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

<link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light+Two&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

<link href='http://fonts.googleapis.com/css?family=Oswald&subset=latin,latin-ext' rel='stylesheet' type='text/css' />

{cms_selflink dir="start" rellink=1}
{cms_selflink dir="prev" rellink=1}
{cms_selflink dir="next" rellink=1}

<!--[if IE 6]>
<__script__ type="text/javascript" src="modules/MenuManager/CSSMenu.js"></__script>
<![endif]-->
{* The above JavaScript is required for Menu - NCleanBlue-css to work in IE6 *}

{* the literal below and the /literal at the end are needed whenever there are {"curly brackets"} as smarty will think it's something to process and will throw an error *}
{* IE6 png fix *}
{literal}
<!--[if IE 6]>
<__script__ type="text/javascript"  src="uploads/NCleanBlue/js/ie6fix.js"></__script>
<__script__ type="text/javascript">
 // argument is a CSS selector
 DD_belatedPNG.fix('.sbar-top,.sbar-bottom,.main-top,.main-bottom,#version');
</__script>
<style type="text/css">
/* enable background image caching in IE6 */
html {filter:expression(document.execCommand("BackgroundImageCache", false, true));} 
</style>
<![endif]-->


{/literal}

{literal}

<__script__ src="http://code.jquery.com/jquery-latest.js"></__script>

{/literal}

</head>

</__body id="short"> 

<!-- TOP -->
<div id="top">


  <!-- Wrapper -->
  <div id="wrapper">
      
      <!-- hlavička --> 
      <div id="header">
  
        <!-- logo -->
        <div class="logo"> <h1>{cms_selflink dir="start" text="$sitename"}</h1>  </div>
        
        <div class="rychle-info">{global_content name='x_hlavicka_kontakt'}</div>
          
        <!-- navigacia -->
        <div class="menu">
        <h2 class="accessibility util-clearb">Navigácia</h2>
        <div class="page-menu util-clearfix">
        {menu loadprops=0 template='cssmenu_ulshadow.tpl'}
        </div>
        <hr class="accessibility util-clearb" />        
        </div>
        <div class="scroller">{global_content name='x_hlavicka_scroller'}</div>         
                
      </div>  
      <!-- hlavička end -->
     
      <!-- obsah -->         
      <div id="obsah">

      <!-- infobox -->  

       {content} 
            
  </div>  <!-- KONIEC OBSAH -->  

   
</div>   <!-- Wrapper center end -->      
  
    <div class="fullfooterone">
      <div class="footer">
      
          <div class="footerbox">
            {global_content name='x_footer_onas'}
          </div>
      
          <div class="footerbox">
            {global_content name='x_footer_kontakt'}
          </div>

          <div class="footerboxx">
            {global_content name='x_footer_formular'}
          </div>
               
          
      </div>  <!-- footer -->
     </div>
     
     <div class="fullfootertwo">
      <div class="paticka">
      
       <div class="footecho"> {global_content name='x_footer'}</div> <div class="footmenu"> {menu loadprops=0 number_of_levels='1'} </div>   
 
      </div>  <!-- paticka -->
     </div>
       
       </div>
<__body>   
</__html>
thank you for your time

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 3:26 pm
by DIGI3
Nothing obvious with the templates that I can see, so possibly something in the global content blocks. Try temporarily removing those to narrow it down.

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 4:07 pm
by urubababumba
Even when I want to create new content same error accure.
https://prnt.sc/10h8vfm
When I switch between contentent type for second it show normal, than it turn to error.

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 4:19 pm
by DIGI3
I've given you a few suggestions and can't really tell if you've tried them. I'll assume you have though.

What if you use one of the default templates supplied with CMSMS - set it as the default then create a new page. If the problem is still there then you likely have a problem with your installation. If it goes away, the problem is with your templates.

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 6:54 pm
by urubababumba
I've tryed all you suggestions. In my opinion problem is with instalation.
Thanks

Re: Duplicate content block: content_en - content page error

Posted: Tue Mar 09, 2021 8:09 pm
by Jo Morg
content_en always refers to the main {content} block so the one without the block= parameter in it. Which means that, assuming this is a recent issue that you have not experienced before, you most likely have, as DIGI3 already pointed out, a hidden default content tag somewhere.
As it seems that it is not in neither of the templates you have posted here it can only be in the GCBs either in {global_content name='x_hlavicka_scroller'}, {global_content name='x_hlavicka_kontakt'}, {global_content name='x_footer_onas'}, {global_content name='x_footer_kontakt'}, {global_content name='x_footer_formular'}, {global_content name='x_footer_gdpr'}, or {global_content name='x_footer'}.
Sometimes frontend developers nest GCBs so one may be calling another and the issue may not be immediately obvious. a good test would be removing the main {content} from the template(s) and trying to save it and seeing if the site still works, and of course if that would be enough for you to be able to submit new content... otherwise search in you DB, if you have access to it, for {content} or {content to try to locate the conflicting tag.

Re: Duplicate content block: content_en - content page error

Posted: Mon Apr 05, 2021 6:06 am
by urubababumba
Hello, after several attempts :
- I removed all global content - take no effect - was not able to save it
- I removed all {content} and content tags - take no effect - was not able to save it
- create new cms default template - was not able to save it
- not able to submit new content - same Duplicate content block: content_en - error

Could It help to try uninstall and reinstall a "newer" version of the modules (CGcontentUtils - my tip)? Or any guess which one could be responsible for this error?
Thanks

Re: Duplicate content block: content_en - content page error

Posted: Mon Apr 05, 2021 2:04 pm
by DIGI3
At this point I think I'd just copy the content to a clean install, something is really messed up there. It could be a module, but it doesn't sound like something a module would (or could) do.

It's a stretch, but you could still look for {content} tags where they shouldn't be. Maybe in global metadata or some other unlikely tag. Maybe try admin search for {content although that doesn't hit everywhere.

Re: Duplicate content block: content_en - content page error

Posted: Mon Apr 12, 2021 9:38 am
by urubababumba
Finaly I locate the source of error. In global metadata this tags caused problems.
<meta name="description" content="{if isset($meta_descr)}{$meta_descr}{else}{content|strip_tags|truncate:'150'|strip}{/if}" />
<meta name='DC.description' content='{if isset($meta_descr)}{$meta_descr}{else}{content|strip_tags|truncate:'150'|strip}{/if}' />

Just for better understandig, where is a problem in syntax?

Thanks for all.

Re: Duplicate content block: content_en - content page error

Posted: Mon Apr 12, 2021 2:57 pm
by DIGI3
You can only use {content} in your templates, or combination of templates, once. If you want to use it more than once you need to assign it to a variable first. Something like:

Code: Select all

{$content={content} scope=global}
Then use $content in your meta tags and later down in your template where content should be output.