Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • David Porré Friend
    #176131

    Hello,

    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 Shapes

    David Porré Friend
    #448399

    I 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 Shapes

    David Porré Friend
    #448402

    Me 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 Shapes

    Ninja Lead Moderator
    #448648

    Hi 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).php

    templates/ja_puresite/html/com_k2/templates/puresite -> category_item.php
    </blockquote>

    This is link download: http://www.mediafire.com/?cd978mtp94hkt1z

    Thanks
    Tam

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Ninja Lead 12 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum