Keyword

Predefined label beside the title of the item

More
9 years 1 month ago #152733 by Jan
Hello,

I have a question. It would be possible add to version 2.7.1 a new feature? I would like to be able to insert predefined label to the title. In some extensions, it is called "marks", "types", "levels" etc.

It is now possible to distinguish items only according to categories and tags. But I need insert to the title of the items "Updated" (but only for important news), "Breaking News", "Exclusively" etc. All the major news sites have these labels.

It's a small thing, but very helpful for me. It would K2 has moved another step forward.

Have a nice day, Jan

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152740 by Krikor Boghossian
Replied by Krikor Boghossian on topic Predefined label beside the title of the item
Hello Jan,

You can easily do this with an extrafield in your overrides.
You can render any extafield using this code as a starting point.
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L104-L109

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

More
9 years 1 month ago #152757 by Jan
Hello Krikor,

That's great, thank you very much. But I do not know how install this extension, or where to place this file or a this code.

Can you help me please?

Have a nice day.

Best regards, Jan

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152800 by Krikor Boghossian
Replied by Krikor Boghossian on topic Predefined label beside the title of the item
No need to install any extension what so ever Jan.
Extrafields are available by default.

You just need to tweak your overrides a bit (getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates)

The code I sent you is a starting point for displaying extrafields anywhere in your template.

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


Powered by Kunena Forum