No "Read More" buttons

GK User
Wed Dec 10, 2014 3:18 pm
In this templates, adding a "read more" to a K2 item does not bring up a "read more" button in a category list. The settings are "read-more" button visible. You can test it on your own site:
http://demo.gavick.com/joomla25/events/

Any idea's?
Appreciated
User avatar
Senior Boarder

teitbite
Fri Dec 12, 2014 11:12 am
Hi

K2 doesn't work with a read more like regular joomla articles. Adding read more only tells K2 which part of the article is an intro and which a full text. Than a read more button has to be configured to show in k2 category configuration.
User avatar
Moderator

GK User
Fri Dec 12, 2014 3:35 pm
In K2 Category: Item view options in category listings, the 'Read more...' link is set to Show.
What needs to be doen to get the 'Read more...' link? Add PHP code?
Thanks
User avatar
Senior Boarder

teitbite
Sun Dec 14, 2014 10:00 pm
Hi

I can see now that K2 style was overriden so most of the element got removed to match the layout. Please add this code to /html/com_k2/templates/default/category_item.php

Code: Select all
   <?php if ($this->item->params->get('catItemReadMore')): ?>
   <!-- Item "read more..." link -->
   <div class="catItemReadMore">
      <a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
         <?php echo JText::_('K2_READ_MORE'); ?>
      </a>
   </div>
   <?php endif; ?>
User avatar
Moderator

GK User
Tue Dec 16, 2014 10:27 am
teitbite wrote:Hi

I can see now that K2 style was overriden so most of the element got removed to match the layout. Please add this code to /html/com_k2/templates/default/category_item.php

Code: Select all
   <?php if ($this->item->params->get('catItemReadMore')): ?>
   <!-- Item "read more..." link -->
   <div class="catItemReadMore">
      <a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
         <?php echo JText::_('K2_READ_MORE'); ?>
      </a>
   </div>
   <?php endif; ?>


Found it. For others struggling with this issue:
Place the code in:
/html/com_k2/templates/xxx/category_item.php
xxx = the template name.
If you use the "sponsors" template, the code should be added to:
/html/com_k2/templates/sponsors/category_item.php

I placed it within: <div class="events-content">:
Code: Select all
          <div class="events-content">
                    <?php if($this->item->params->get('catItemTitle')): ?>
                    <h3>
                              <?php if ($this->item->params->get('catItemTitleLinked')): ?>
                              <a href="<?php echo $this->item->link; ?>">
                              <?php
                  $title_data = explode('--', $this->item->title);
                  if(count($title_data) > 1) {
                     echo $title_data[0] . '<small>' . $title_data[1] . '</small>';
                  } else {
                     echo $title_data[0];
                  }
               ?>
                              </a>
                              <?php else: ?>
                              <?php
                  $title_data = explode('--', $this->item->title);
                  if(count($title_data) > 1) {
                     echo $title_data[0] . '<small>' . $title_data[1] . '</small>';
                  } else {
                     echo $title_data[0];
                  }
               ?>
                              <?php endif; ?>
                    </h3>
                    <?php endif; ?>
                    <?php echo $this->item->event->AfterDisplayTitle; ?> <?php echo $this->item->event->K2AfterDisplayTitle; ?>
                    <?php if($this->item->params->get('catItemIntroText')): ?>
                    <?php echo $this->item->introtext; ?>
                    <?php if(isset($this->item->editLink)): ?>
                    <a class="catItemEditLink modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>"> <?php echo JText::_('K2_EDIT_ITEM'); ?> </a>
                    <?php endif; ?>
                    <?php endif; ?>
                    <?php if ($this->item->params->get('catItemReadMore')): ?>
                    <!-- Item "read more..." link -->
                    <div class="catItemReadMore">
                       <a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
                        <?php echo JText::_('K2_READ_MORE'); ?>
                        </a>
                    </div>
                    <?php endif; ?>
          </div>


Thanks a lot!
User avatar
Senior Boarder

teitbite
Fri Dec 19, 2014 11:41 am
Hi

No problem. Glad I could help :)
User avatar
Moderator

GK User
Sun Sep 11, 2016 11:39 am
*subscribe*
User avatar
Platinum Boarder

teitbite
Tue Sep 13, 2016 2:10 pm
Hi

What do You mean @skullmonkey ? Do You need a help with similar problem ?
User avatar
Moderator

GK User
Tue Sep 13, 2016 2:15 pm
Hi Teitbite,
since there is no subscribe option to topic that I often need I do it this way so I can easily find it in future using View your posts.
This topic helped me.

Gorast
User avatar
Platinum Boarder

teitbite
Thu Sep 15, 2016 3:06 pm
Hi

Is it not showing for You? For me it's below the thread in left bottom corner.
User avatar
Moderator

GK User
Thu Sep 15, 2016 3:08 pm
Huh what do you know. I never saw it at the bottom. I always look at the top of the topic. Cool. Thanks :)
User avatar
Platinum Boarder

teitbite
Sat Sep 17, 2016 5:04 pm
Hi

No problem :) I'm closing this thread since we are getting offtopic.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.