Keyword

Making easy use of K2 with items and pagination

  • Stevan van de Merkt
  • Stevan van de Merkt's Avatar Topic Author
  • Offline
  • New Member
More
13 years 1 month ago #99138 by Stevan van de Merkt
Making easy use of K2 with items and pagination was created by Stevan van de Merkt
Hi all,I've been using K2 to post simple news items for a friend of mine.However from my current point of view I have to code too much to let it look just the way het wants it.What do we want to show?As you see the date as following 14/10/2008, the title, an image next to the item. No read more or other stuff. Also he wants to show 3 items and use pagination for the older newsitems he wants to post.I already found a way to show the image on the right side (I only use ITEM).How do I change the date setting to show ik like in the example?Is there a way to change/style the pagination as seen in the example? (now left and right arrow with page 1 of 5) or something close to it.Thanks in advance.Br,Steve

Please Log in or Create an account to join the conversation.

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
13 years 1 month ago #99139 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Making easy use of K2 with items and pagination
For the date : Open components/com_k2/templates/default/item.php -> look for line 47

 

Change

<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>

 

To

<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT')); ?>

 

this will give the date as 14/11/2008 - 9.50 <- which includes the time.

 

If you want to remove the time then you need to edit the language/en-GB.com_k2.ini -> look for line 78

 

Change :

K2_DATE_FORMAT="%d/%m/%Y - %H:%M"

 

To :

K2_DATE_FORMAT="%d/%m/%Y" <- remember to change back when you upgrade k2

 

As for editing the item.php file, it's better to use template overrides. See here

 

The pagination can be achieved with styling.

K2 Rocks \m/

Please Log in or Create an account to join the conversation.

  • Stevan van de Merkt
  • Stevan van de Merkt's Avatar Topic Author
  • Offline
  • New Member
More
13 years 3 weeks ago #99140 by Stevan van de Merkt
Replied by Stevan van de Merkt on topic Making easy use of K2 with items and pagination
Hi Kannan,Thank you for your feedback.I changed the settings and everything works fine now.I still have a problem with the pagination. It's not clear for me where I can change the styling.In k2.css I see the code but it's not much to work with.Where can I find "<< last, next >>  for examle? Do you have any experience with this? Or do you have some example to point me in the right way?Best regards,Steve

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum