-
AuthorPosts
-
David Porré Friend
David Porré
- Join date:
- September 2014
- Posts:
- 194
- Downloads:
- 44
- Uploads:
- 5
- Thanks:
- 23
- Thanked:
- 9 times in 1 posts
April 14, 2012 at 12:37 pm #176131Hello,
I found out a little bug here in K2 blog layout (using puresite template).
I tried to disable K2 comments on my blog page (using puresite template).
I had 2 problems.
First, the “comment” button was still on the page, so I had to delete one line from templates/ja_puresite/html/com_k2/templates/puresite/category_item.php (line 205 : <?php else: ?>).
Second, it broke the layout, no more border between the articles, and the right column went to bottom of page, so I had to add one div closing to templates/ja_puresite/html/com_k2/templates/puresite/category_item.php (line 211 : </div>).
I changed :
<!-- Anchor link to comments below -->
<div class="catItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<?php else: ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('Comment'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>to :
<!-- Anchor link to comments below -->
<div class="catItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('Comment'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div></div>And now it’s OK.
Hope this will help.
Best regards,
David aka ShapesDavid Porré FriendDavid Porré
- Join date:
- September 2014
- Posts:
- 194
- Downloads:
- 44
- Uploads:
- 5
- Thanks:
- 23
- Thanked:
- 9 times in 1 posts
April 14, 2012 at 2:09 pm #448399I thought it was OK, but not really, I lost also intro text in the layout.
But I can’t figure out why.If I turn comments back on, the intro text is back. But the layout is broken, surely because of my modifications.
So I think my modifications are not perfect, but I can’t figure out where’s the trick…
Can anybody help ?
Hoping for answers,
Best regards,
David aka ShapesDavid Porré FriendDavid Porré
- Join date:
- September 2014
- Posts:
- 194
- Downloads:
- 44
- Uploads:
- 5
- Thanks:
- 23
- Thanked:
- 9 times in 1 posts
April 14, 2012 at 2:21 pm #448402Me again…
Defenitly some work to do on this K2 template..I solved the intro problem by changing some code again in templates/ja_puresite/html/com_k2/templates/puresite/category_item.php (line 134).
We have :
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
</div>
<?php if($this->item->params->get('catItemIntroText')): ?>
<!-- Item introtext -->
<div class="catItemIntroText clearfix">
<?php echo $this->item->introtext; ?></div>
<?php endif; ?><?php endif; ?>
We can see the intro text is included in :
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
So Ichanged it to :
<?php if($this->item->params->get('catItemIntroText')): ?>
<!-- Item introtext -->
<div class="catItemIntroText clearfix">
<?php echo $this->item->introtext; ?></div>
<?php endif; ?>Intro text is back, but layout is broken again, because of the </div> I added before. so I deleted it line 195, I changed :
<!-- Anchor link to comments below -->
<div class="catItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('Comment'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div></div>to
<!– Anchor link to comments below –><div class="catItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('Comment'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>And now everything seems fine.
But I still think Joomlart guys should take a look here to update cleanly this template.
It works fine, but I don’t know if my changes are really perfect.The same bugs seem to happen in templates/ja_puresite/html/com_k2/templates/puresite_blog/category_item.php also.
Best regards,
David aka ShapesNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
April 17, 2012 at 2:22 am #448648Hi Shapes,
Thanks for your feedback. I have checked on our system and changed something on override k2 component. Please update both file below
<blockquote>
templates/ja_puresite/html/com_k2/templates/puresite_blog -> category_item(fix blog).phptemplates/ja_puresite/html/com_k2/templates/puresite -> category_item.php
</blockquote>This is link download: http://www.mediafire.com/?cd978mtp94hkt1z
Thanks
Tam -
AuthorPosts
This topic contains 4 replies, has 2 voices, and was last updated by Ninja Lead 12 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum