Keyword

Change to individual K2 items <!-- Featured flag --> words??

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
6 years 11 months ago #168536 by Chris Hogan
Hi there,

Can you please advise if it is possibly to change individual K2 items <!-- Featured flag --> please see image for the area that I wish to change from the words 'featured to 'Expired' for example.



Thanks
Attachments:

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #168543 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change to individual K2 items <!-- Featured flag --> words??
Hello,

This is an HTML comment which is not rendered.
The Expired text is either hardcoded in your template (check the item.php file) or you are using language overrides.

docs.joomla.org/J3.x:Language_Overrides_in_Joomla
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

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

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
6 years 11 months ago #168580 by Chris Hogan
Hi there, the wording normally says 'Featured' (if I selected for the item to appear on the homepage) but I just changed to 'Expired' on the page inspect as an example.

As for the item.php as I believe this would change all my stories/items this won't really work as I need an option to remove older news (and take off featured) so I just need some type of method to get the text 'Expired' in the same style /and area as the Red Coloured 'Featured Text'

Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #168586 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change to individual K2 items <!-- Featured flag --> words??
You can use an extrafield which can be rendered explicitly github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173
Since you can use your own markup in that field, you can use the featured flag's markup and classes.

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

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
6 years 11 months ago #168610 by Chris Hogan
Hi there,

Thanks for the info but could you explain the process I need to take to accomplish this?

Regards!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #168614 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change to individual K2 items <!-- Featured flag --> words??
You need to create a new extrafield and override the item.php file.
If you haven't, you must do it so you won't lose your changes getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub

In the item.php file, inside the <sup>element which is used to display the featured flag you can render the extrafield's value use this code as a starting point github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173

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


Powered by Kunena Forum