Duplicate Blocks
Permalink
I have an issue with duplicate blocks appearing on the default PageList / Blog Entry page. The duplicate entries shown in the attached screen dump cannot be edited or deleted. This happened when adding the the default Blog Entry page into a Marketplace purchased theme. Can anyone suggest why it is happening and how to fix this as I have wandered around code aimlessly trying.

Which theme? It could be a duplicate area name in the theme itself.
Hi
It's the Minified, Vivatemplates theme. I've had lots of communication with them and offers to fix it but just doesn't happen not sure why. Hope you can help. Many thanks.
It's the Minified, Vivatemplates theme. I've had lots of communication with them and offers to fix it but just doesn't happen not sure why. Hope you can help. Many thanks.
You could check and confirm if the blog page type in your theme uses duplicate code using the firebug plugin for Firefox.
I've pasted from Firebug below, yes the block is duplicated. In fact the block that shows first on screen is the duplicate as the breadcrum trail should appear first. I don't know the cause or how to resolve it though.
<div id="sub-content-full">
<h1>
<cufon class="cufon cufon-canvas" alt="Blog " style="width: 84px; height: 36px;">
<canvas width="110" height="38" style="width: 110px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>Blog </cufontext>
</cufon>
<cufon class="cufon cufon-canvas" alt="page" style="width: 93px; height: 36px;">
<canvas width="108" height="38" style="width: 108px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>page</cufontext>
</cufon>
</h1>
<p> </p>
<p> </p>
<div class="pageSection">
<a href="/">Home</a>
<span class="ccm-autonav-breadcrumb-sep">></span>
<a href="/index.php/blog/">Blog</a>
<span class="ccm-autonav-breadcrumb-sep">></span>
Blog page
</div>
<div class="pageSection">
<h1>
<cufon class="cufon cufon-canvas" alt="Blog " style="width: 84px; height: 36px;">
<canvas width="110" height="38" style="width: 110px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>Blog </cufontext>
</cufon>
<cufon class="cufon cufon-canvas" alt="page" style="width: 93px; height: 36px;">
</h1>
<p class="meta">Posted by admin on July 6, 2011</p>
</div>
<div class="pageSection">
<p> </p>
<p> </p>
</div
<div id="sub-content-full">
<h1>
<cufon class="cufon cufon-canvas" alt="Blog " style="width: 84px; height: 36px;">
<canvas width="110" height="38" style="width: 110px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>Blog </cufontext>
</cufon>
<cufon class="cufon cufon-canvas" alt="page" style="width: 93px; height: 36px;">
<canvas width="108" height="38" style="width: 108px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>page</cufontext>
</cufon>
</h1>
<p> </p>
<p> </p>
<div class="pageSection">
<a href="/">Home</a>
<span class="ccm-autonav-breadcrumb-sep">></span>
<a href="/index.php/blog/">Blog</a>
<span class="ccm-autonav-breadcrumb-sep">></span>
Blog page
</div>
<div class="pageSection">
<h1>
<cufon class="cufon cufon-canvas" alt="Blog " style="width: 84px; height: 36px;">
<canvas width="110" height="38" style="width: 110px; height: 38px; top: -2px; left: -1px;"></canvas>
<cufontext>Blog </cufontext>
</cufon>
<cufon class="cufon cufon-canvas" alt="page" style="width: 93px; height: 36px;">
</h1>
<p class="meta">Posted by admin on July 6, 2011</p>
</div>
<div class="pageSection">
<p> </p>
<p> </p>
</div
Did you cross - check this code with the blog.php file in your themes ?
Yes I've checked all the blog_entry.php file it's using and it's as it should 'out of the box' in the default Concrete install. The duplicated block is not in the .php file.
I think I'm getting somewhere now but don't have enough experience yet to know what's going on exactly. It seems that the view.php is executing as well and displaying before executing the blog_entry.php. Why? Help?
I think I'm getting somewhere now but don't have enough experience yet to know what's going on exactly. It seems that the view.php is executing as well and displaying before executing the blog_entry.php. Why? Help?
I think I've answered my own question... I've replaced the view.php file in the theme with the default Concrete one and that's fixed my problem. Looking at the content of the offending file I wonder if it's accidently been overwritten with eroneous code? See offending code below...
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>
<div id="image-placeholder">
<?php $a = new Area('TopImage'); $a->display($c); ?>
</div>
<div id="sub-content-full">
<?php $pageTitle = $c->getCollectionName(); ?>
<h1><?php echo $pageTitle?></h1>
<?php $a = new Area('Main'); $a->display($c); ?>
<?php print $innerContent; ?>
</div>
<br style="clear: both;" /><br />
<?php $this->inc('elements/footer.php'); ?>
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>
<div id="image-placeholder">
<?php $a = new Area('TopImage'); $a->display($c); ?>
</div>
<div id="sub-content-full">
<?php $pageTitle = $c->getCollectionName(); ?>
<h1><?php echo $pageTitle?></h1>
<?php $a = new Area('Main'); $a->display($c); ?>
<?php print $innerContent; ?>
</div>
<br style="clear: both;" /><br />
<?php $this->inc('elements/footer.php'); ?>
Sounds like you've resolved your issue, but in case you're wondering, the reason this happened is because whoever built that theme put a "Main" content area in the theme's view.php file and didn't provide a template for the blog_entry page type. Since they didn't provide a template for blog_entry, the system defaults to using its own template and inserting it inside the view.php template. Now the system default template (which can be found in YOURSITE/concrete/page_types/blog_entry.php) also has a "Main" are in it. So this code with the "Main" area is being inserted into the view.php file which also has a "Main" area.
I think a better fix for you is to create a blog_entry.php template in the theme. All you need to do is make a copy of the view.php file and rename the copy to "blog_entry.php", then edit that file and find these two lines:
...and replace those with this code (which I copied out of concrete/page_types/blog_entry.php):
If you're feeling generous you should also send a link to this forum thread to the author of that theme so they can fix it.
I think a better fix for you is to create a blog_entry.php template in the theme. All you need to do is make a copy of the view.php file and rename the copy to "blog_entry.php", then edit that file and find these two lines:
<?php $a = new Area('Main'); $a->display($c); ?> <?php print $innerContent; ?>
...and replace those with this code (which I copied out of concrete/page_types/blog_entry.php):
<div class="pageSection"> <?php $ai = new Area('Blog Post Header'); $ai->display($c); ?> </div> <div class="pageSection"> <h1><?php echo $c->getCollectionName(); ?></h1> <p class="meta"><?php echo t('Posted by')?> <?php echo $c->getVersionObject()->getVersionAuthorUserName(); ?> on <?php echo $c->getCollectionDatePublic('F j, Y'); ?></p> </div> <div class="pageSection"> <?php $as = new Area('Main'); $as->display($c); ?> </div> <div class="pageSection"> <?php $a = new Area('Blog Post More'); $a->display($c); ?> </div> <div class="pageSection"> <?php $ai = new Area('Blog Post Footer'); $ai->display($c); ?>
Viewing 15 lines of 16 lines. View entire code block.
If you're feeling generous you should also send a link to this forum thread to the author of that theme so they can fix it.