VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: welrachid on October 29, 2018, 12:47:54 PM

Title: custom field on category
Post by: welrachid on October 29, 2018, 12:47:54 PM
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.
Title: Re: custom field on category
Post by: Studio 42 on October 29, 2018, 22:06:58 PM
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).
Title: Re: custom field on category
Post by: welrachid on October 30, 2018, 11:36:53 AM
Arh. nice hack. You are ofcourse talking about Joomla language overrides, correct? :)
Title: Re: custom field on category
Post by: Studio 42 on October 30, 2018, 18:25:17 PM
Yes, you have function to verify if a key exist JLanguage::hasKey
Title: Re: custom field on category
Post by: welrachid on October 30, 2018, 22:10:32 PM
Sweet. Thanks!