Keyword

Remove time on frontpage

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Senior Member
More
1 week 2 days ago #180819 by Chris
Remove time on frontpage was created by Chris
I use K2 Articles on my frontpage (K2 » Item listings » Categories)  Is there a way to remove the 24hr time from my article selection menu on my frontpage, seems like un-needed bloat

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

More
1 week 2 days ago #180820 by JoomlaWorks
Replied by JoomlaWorks on topic Remove time on frontpage
All such options are under each category's settings. If you have lots of categories, it makes sense to create a "template" category and have all others (or some) inherit the display options of this "template" category.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Senior Member
More
1 week 2 days ago #180821 by Chris
Replied by Chris on topic Remove time on frontpage
I don't want to disable the date of creation however, you cannot disable the time without disabling the dates, i don't want to do that. The Dates make sense, the times don't

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

More
1 day 10 hours ago #180836 by JoomlaWorks
Replied by JoomlaWorks on topic Remove time on frontpage
~ The quick way:
Locate K2_DATE_FORMAT_LC2 in your frontend language files. This is a language string defined in K2's language files and if you change it, it will instantly change any part of K2 in the frontend that uses it (most).

github.com/getk2/k2/blob/d0c84174ea9c07b80675b62daa028fce1612085c/language/en-GB/en-GB.com_k2.ini#L43

Change K2_DATE_FORMAT_LC2="%A, %d %B %Y %H:%M" to K2_DATE_FORMAT_LC2="%A, %d %B %Y" for example.

~ The clean way:
Create a sub-template (with an override for category_item.php) and have one ore more categories use that sub-template wherever you like. The category_item.php override you'll make can have a different date/time format.

E.g. in this line getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates you'd change JText::_('K2_DATE_FORMAT_LC2') to JText::_('Y.m.d') to show just the date (date formatting is here: www.php.net/manual/en/datetime.format.php).

Read this for more info on K2 templating: getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum