News:

Looking for documentation? Take a look on our wiki

Main Menu

custom field on category

Started by welrachid, October 29, 2018, 12:47:54 PM

Previous topic - Next topic

welrachid

Hi guys.
using the newest VM 3.4.2 is it possible to somehow get a custom text for each category that is NOT the description?

I looking for a way to put in custom html or text into these boxes:
https://prnt.sc/lbrkzu

This is a front-page category display, where for most categories im going to list of all subproducts in a <ul><li> form. But there might be some categories where i wish to maybe describe or show something custom for that category.


Thanks.
Best regards,
Wel

Studio 42

You can use a Joomla KEY using the ID of the category for eg.
Eg.
vmText::_('VM_CATEGORY_CUSTOM_'.$catId);
Of course you need to check if the key exist and set a Joomla KEY per category id. But if you only need it for 5 or 6 categories or view, it's a simple and fast way to do it(and do not use server resource with a plugin).

welrachid

Arh. nice hack. You are ofcourse talking about Joomla language overrides, correct? :)
Best regards,
Wel

Studio 42

Yes, you have function to verify if a key exist JLanguage::hasKey

welrachid

Best regards,
Wel