- Posts: 190
COMMUNITY FORUM
Hide extra field if value is empty
- Nick
-
Topic Author
- Offline
- Elite Member
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.
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
Please Log in or Create an account to join the conversation.
- Anthony Antonellis
-
- Offline
- Junior Member
- Posts: 23
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
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.
Please Log in or Create an account to join the conversation.
- Francisco Ferreira
-
- Offline
- Junior Member
- Posts: 28
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.
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
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...
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
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...
Please Log in or Create an account to join the conversation.
- Francisco Ferreira
-
- Offline
- Junior Member
- Posts: 28
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...
Please Log in or Create an account to join the conversation.
- Jason Noel
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Cheche
-
- Offline
- New Member
- Posts: 4
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.
Please Log in or Create an account to join the conversation.
- strummsteel
-
- Offline
- Junior Member
- Posts: 38
You can use the the excellent k2 plugin here to filer your extra fields content: 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?
Please Log in or Create an account to join the conversation.
- troponin
-
- Offline
- Platinum Member
- Posts: 398
Please Log in or Create an account to join the conversation.
- strummsteel
-
- Offline
- Junior Member
- Posts: 38
Please Log in or Create an account to join the conversation.
- strummsteel
-
- Offline
- Junior Member
- Posts: 38
Please Log in or Create an account to join the conversation.
- Geoffww
-
- Offline
- New Member
- Posts: 8
This forum doesn't support
{div class="itemExtraFields"}
{h3}Additional Info{/h3}
{ul}
{li class="even typeTextfield group2"}
{span class="itemExtraFieldsLabel"} Label: {/span}
{span class="itemExtraFieldsValue"} Value{/span},{br class="clr"/},{/li}
{li class="odd typeTextfield group2"},{span class="itemExtraFieldsLabel"}Width:{/span} {span},{/span},{br class="clr"/},{/li}
{/ul}
{/div}
If you don't like something about their output edit the K2.css fill for that class.
Please Log in or Create an account to join the conversation.
- Geoffww
-
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Olivier
Geoff WW said:Implementing Olivier Nolbert's code causes Odd and Even rows to be out of sync.
Please Log in or Create an account to join the conversation.
- Geoffww
-
- Offline
- New Member
- Posts: 8
Olivier Nolbert said:Do you have an example ? Olivier
Geoff WW said:Implementing Olivier Nolbert's code causes Odd and Even rows to be out of sync.
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
It's clear for me now. Sorry.
Well, i think it's possible to check the rows in js after have hidden the empty fields.
I'll take a look this weekend.
Olivier
Geoff WW said:Sure. For example I have 5 fields. For the output, the first field will have the gray color second field will have white third field will have the gray so on and so forth. When I leave the second field blank the third field will have the gray color so what happens with the output I have two rows with the gray. Indeed the ExtraField row is hidden but the odd/even coloring is out of sync. Not sure if that can be fixed. Are "odd" and "even" actual variables that can be checked for so they can be switched when the preceding ExtraField is empty?
Olivier Nolbert said:Do you have an example ? Olivier
Geoff WW said:Implementing Olivier Nolbert's code causes Odd and Even rows to be out of sync.
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
I think there's a php solution in the code i've previously posted but this one works.
Olivier
Please Log in or Create an account to join the conversation.