K2 Community

Join the network of the powerful content component for Joomla!

It would be great if an empty field would be hidden if it's value output is empty. I coded something myself which hides an extra field if the value is empty but it only seems to work with single box fields (text box) as it has only 1 value. Links for example have 3 values and will not hide for a retarded reason. Could JoomlaWorks send me a code snippet that would hide ANY extra field if the value output echoe's as empty. I can't seem to figure it out...
I keep pushing this for the 3rd time. Not because i'm an asshole, but because Joomlaworks doesn't even reply to 90% of the posts in their forums. Now that is just stupid.

I believe that this will make extra fields SO MUCH more usefull, and it gets rid of the group's. I hate them.

Tags: extra, field, groups, hide

Reply to This

Replies to This Discussion

BUMPING THIS. WHERE ARE THE DEVS?

Reply to This

Agree. This option to be able to hade empty extra fields would really help out. When you start to use the extrafields you quickly realize they take up alot of space, and when articles (items) don't have the same type of content some extrafields is sometimes left empty.

Getting around 7-10 extrafields and the contenpage is starting to be really enoying and the whole concepts of extrafields is getting none useble, even with the great extrafields groups.

Reply to This

i managed to hide the empty fields, it took a little reworking of the css and the template but its definitely doable. it works in everything so far, except the beloved ie6.

Reply to This

omfg how did you do that!!!! omfg omfg omfg please tell me! This way i might be able to perfect it with some php and make it work in ie6 :O

Anthony Antonellis said:
i managed to hide the empty fields, it took a little reworking of the css and the template but its definitely doable. it works in everything so far, except the beloved ie6.

Reply to This

Hi Anthony,

Can you share your solution with us?

Many thanks in advance,

Francis

Anthony Antonellis said:
i managed to hide the empty fields, it took a little reworking of the css and the template but its definitely doable. it works in everything so far, except the beloved ie6.

Reply to This

Hi everyone,

here's my solution to hide the fields with empty value :

I've added some code to the div that displays ExtraFields in my own item.php k2 template file.
Here's the code of my div...

Hope it will help...
Attachments:

Reply to This

Bravo... that's all i can say. It fucking worked.

Here are some issues tho, not a problem but just pointing it out.

The field ONLY disappears when the link area contains http:// that's the only case. It even disappears when the description area has text in it. If the link part contains http:// the field will disappear, no matter what. It's cool tho! Thanks a lot!

I think i just jizzed in my pants.

Olivier Nolbert said:
Hi everyone,

here's my solution to hide the fields with empty value :

I've added some code to the div that displays ExtraFields in my own item.php k2 template file.
Here's the code of my div...

Hope it will help...

Reply to This

It Works!!!!! It works!!!! Alleluia, praise the lord ;-)...

You just saved my life man!!!

Many thanks for a great job!!!

Olivier Nolbert said:
Hi everyone,

here's my solution to hide the fields with empty value :

I've added some code to the div that displays ExtraFields in my own item.php k2 template file.
Here's the code of my div...

Hope it will help...

Reply to This

Wow... Thanks a lot!!!! This works perfectly!

Reply to This

Nolbert,

Thank you so much for providing this code. Well thought out solution and works just like it should. You saved me from having to program my own solution and I can't thank you enough.

This should definitely be added to the K2 core.

Reply to This

Actually, since we can use the extra field as another way of organizing content.

You can use the the excellent k2 plugin here to filer your extra fields content: http://community.getk2.org/forum/topics/k2-extra-fields-filter-and

Is there a way for us to actually hide, extra fields even when they are not empty?

Reply to This

just deselect options "Show Extra Fields" in the Cat in Backend

Reply to This

Reply to This

RSS

Advertisement

Latest Activity

Plz send a link if site is live
2 hours ago
See the k2 menu choices at the bottom - latest from user or categories select the category and set the number of items and it will work
2 hours ago
FidelGonzales added a discussion
I'm having some issues getting my categories to appear properly. The culprit seems to be the following code: . In default form, there is a huge gap on the top of the category page. After removing a few of these, the issue is partially fixed with cer…
2 hours ago
someone better that i may can tell you, try commenting the div class clr's our and see what happens
2 hours ago
Thanks for the reply. Unfortunately I'm not so experienced with Firebug nor CSS. I attached a new image, where one can see more information. Does this help a bit more?
2 hours ago
Whatever is done will modify the core, but will work. How about putting the category id's in a field like the xtra filelds and teach the core to parse them out. Its changing the way things work - not likely to happen unless a module like followeyes…
2 hours ago
I don't think the concept of the single-category per item content structure is a way of thinking that is advanced and, therefore, a reason to change the content construction strategy and our subsequent way of thinking. It is merely a huge limitation…
2 hours ago
2. if you are trying to remove a video from an item in the backend, click on the video tab scroll to the bottom and check delete currrent and save
2 hours ago
Please post a link if the site is live Use firebug to see what there and what needs to be changed
3 hours ago
Also, to skip the extra field you dont want edit in the override item.php and put something like {pseudocode} phpif this->extrafield->name="fieldyouwantto skip" else let the rest of the existing foreach loop run phpendif endfor something like that s…
3 hours ago
Kibekas added a discussion
There is a problem with excess of free space between 'itemListSubCategories' and 'itemList'. It seems to be derving from div class 'itemlistsubcategories' Please see the image attached. Does anyone know how to solve this problem? Via CSS?Thanks!
3 hours ago
you can get the extra fields like this if it suits your needs $custom = $this->item->extra_fields; and then addressing extra fields for the item like echo $custom[1]->value; depending on the position, 0, 1,2,3,4 etc in the array experiment with this…
3 hours ago
Kibekas, Ninja B, Dene Goodwin and 1 more joined K2 Community
3 hours ago
deton and Daito joined JoomlaWorks's group
For K2 translators
3 hours ago
I can translate to Russian
3 hours ago
I have a case right now where I would love to be able to set several categories for one article. For now, it has been solved with the use of tags, and I suspect this is how we will have to use it in the future. It might just be that we are used to…
3 hours ago
Viktoria (and Simon), Did you ever find out how to put one single extra field (not the whole bunch...) a different place than at the bottom of the article? This means we need to have a way to identify this particular field and add the code for it…
3 hours ago
Valentine added a discussion
Greetings to all . So here is what i cant understand1. i Cant login as an admin tru k2 login in frontend form just resets and i see begining of page2. I cant understand how to remove Related videos Any help will be good thanks in advance
3 hours ago
I can translate to German
5 hours ago
Sorry man, I wish I had more time to re-analize. You'll have to tweak things around. Trial and error man.
6 hours ago

© 2010   Created by JoomlaWorks.

Badges  |  Report an Issue  |  Terms of Service