List Manager Forum

Card question

User moon_1262 2015-07-17 18:05:12

Hi,

I am trying to find a way to prevent displaying of field label in card view when there is no data for that field...

I tried using jQuery and :empty selector but somehow that did not work. Maybe because of the way LM loads.

Anybody thinks of another way ?

Thanks,
Regards,
--
Pascal

Moonsoft support 2015-07-18 09:37:51

Hi,

If you have average knowlegde of jquery, you can add script code after cards loaded. Cards are loaded using 'createCardLayout...()' function at JOOMLA/modules/mod_listmanager/tmpl/content.php, so you can add jquery code at the end of this function (around line 554).

Regards,

User moon_1262 2015-07-21 10:20:22

Thanks. That did it.

So for anyone interested, you just have to add the following jQuery at the line 546 of /modules/mod_listmanager/tmpl/content.php :

jQuery(".lmcardcontentblock>.lmcarditem_name+.lmcarditem_data:empty").parent().remove();

to remove entire block when there is no data for a field.


Regards,
--
Pascal

Moonsoft support 2015-07-21 10:55:45

Great it worked, thanks for sharing.


Regards

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!