Back/Next Buttom in k2 item

GK User
Mon Mar 12, 2012 12:05 pm
Hi,
in my site I would like to implement "next" and "back" buttom at the bottom of k2 item as in the image that I attach, which I got from another website that has used the same template (The world news II)
Could you help me?
Thank you
User avatar
Senior Boarder

teitbite
Sat Mar 17, 2012 12:20 am
Hi

This part ot K2 item is called navigation, all You need to do is to simply enable it in category/item/menu item settings.
User avatar
Moderator

GK User
Sat Mar 17, 2012 8:40 pm
Hi and thank you for your reply.
I've already activeted "item navigation" but the buttons (Back and next) don't appear, but only the title of item.
How can I see the buttons?
User avatar
Senior Boarder

GK User
Tue May 08, 2012 10:00 am
Please any reply?
And how can I align the previous item on the left and the next item on the right (always in the navigation bar)?
Thank you.
Please help me!
User avatar
Senior Boarder

teitbite
Tue May 08, 2012 3:27 pm
Hi

Sorry I got unsubscribed from this thread and just found it before Your post.

Please show me an exact page with example of this.
User avatar
Moderator

GK User
Tue May 08, 2012 3:51 pm
Hi, don't worry and thank you for your reply.
I explain you my request.
Now, with navigation bar activeted (on item view) I see it like the image enclosured.
Instead I would like to show the two button as the first image on this topic (back and next) and to align the "previous item" on the left and the "next item" on the right.
Unfortunately my website it's in local and I can't send you the link of the page.
Thank you for your reply
User avatar
Senior Boarder

teitbite
Wed May 09, 2012 5:07 pm
Hi

No no. I understand what Your request is :)

I only need an exact url to a page with an example so I'll be able to give You exact CSS code to make it.
User avatar
Moderator

GK User
Wed May 09, 2012 5:19 pm
Here it is
http://demo.gavick.com/joomla16/jul2011 ... -long-fall
And before i sent you an e-mail on other post request.
Thank you.
User avatar
Senior Boarder

teitbite
Wed May 09, 2012 6:03 pm
Hi

I can see Prev and Next button on our demo :) This is why I asked for an example on Your site so I'll be able to check and tell what's wrong or how to add it using css if it's lacking somehow.
User avatar
Moderator

GK User
Fri Aug 03, 2012 4:20 pm
This might help someone. Normally templates which incorporate K2 (like this template) have file overrides for the K2 core - all located here: templates -> "your template" -> html -> com_K2

If you have a template which has a K2 override for the item page it will be here: templates -> "your template" -> html -> com_K2 -> templates -> default -> index.php

If you have installed K2 separately and have no override I recommend adding the folder and files to create the above path and copy the file contents over. If you wish to edit the core K2 code go here: component -> com_K2 -> templates -> default -> item.php

In item.php look for this block around line 544:

<div class="itemNavigation">
<span class="itemNavigationTitle"><?php echo JText::_('K2_MORE_IN_THIS_CATEGORY'); ?></span>

<?php if(isset($this->item->previousLink)): ?>
<a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">
&laquo; <?php echo $this->item->previousTitle; ?>
</a>
<?php endif; ?>

<?php if(isset($this->item->nextLink)): ?>
<a class="itemNext" href="<?php echo $this->item->nextLink; ?>">
<?php echo $this->item->nextTitle; ?> &raquo;
</a>
<?php endif; ?>

</div>

Change to the following:

<div class="itemNavigation">

<?php if(isset($this->item->previousLink)): ?>
<a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">
Previous
</a>
<?php endif; ?>

<?php if(isset($this->item->nextLink)): ?>
<a class="itemNext" href="<?php echo $this->item->nextLink; ?>">
Next

<?php endif; ?>

</div>

The above replaces the item titles with the words: Next and Previous instead of the article titles. It also removes the "more in this category" text.

To turn them into buttons and change background color etc add/change the css for the div till happy - /k2.css.
User avatar
Fresh Boarder

teitbite
Sun Aug 05, 2012 12:54 pm
Hi

Och, so that was the problem. Sorry, I don't understood the first time. @Actions Equal Results thank You for this post.
User avatar
Moderator


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