Keyword

Hide extra field if value is empty

More
14 years 8 months ago #71704 by strummsteel
Replied by strummsteel on topic Hide extra field if value is empty
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: 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.

More
14 years 8 months ago #71705 by troponin
Replied by troponin on topic Hide extra field if value is empty
just deselect options "Show Extra Fields" in the Cat in Backend

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #71706 by strummsteel
Replied by strummsteel on topic Hide extra field if value is empty
Hey thanks for the info, but i meant, hide items within the extra fields. Currently its all or nothing, is there a way to show or hide them selectively?

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #71707 by strummsteel
Replied by strummsteel on topic Hide extra field if value is empty
Devs? update please?

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #71708 by Geoffww
Replied by Geoffww on topic Hide extra field if value is empty
My workaround is to not use Extra Fields but use their classes and make my own lists in the Content section.
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.

More
14 years 8 months ago #71709 by Geoffww
Replied by Geoffww on topic Hide extra field if value is empty
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.

More
14 years 8 months ago #71710 by Jiliko.net
Replied by Jiliko.net on topic Hide extra field if value is empty
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.

More
14 years 8 months ago #71711 by Geoffww
Replied by Geoffww on topic Hide extra field if value is empty
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.

More
14 years 8 months ago #71712 by Jiliko.net
Replied by Jiliko.net on topic Hide extra field if value is empty
Ok,

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.

More
14 years 8 months ago #71713 by Jiliko.net
Replied by Jiliko.net on topic Hide extra field if value is empty
The js solution (mootools) to fix the extrafields li odd/even classes

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.


Powered by Kunena Forum