fieldgroup and empty value in child field

More
1 month 1 week ago #85814 by kath
hi there,

my question is:
i have a fieldgroup "text-img-slide" with child fields "text", "image", and the child fields are optiona.
i create carousels with that.
for certain reasons i read the flexicontent-item's child fields' values into a php array and work with that.

problem-example:
slide 1 / fieldgroup-element 1 has a missing image.
that leads to: the seconds image lands in the first array element, because flexicontent (in my setup) does not store an empty value for the empty image in the fieldgroup's first element.

my question:
Can I configure the groupfield, or the child fields to save a null-value or similar in case of empty value?

I hope you can understand the scenario, thanks for reading,
Benjamin :)

 

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

More
3 weeks 4 days ago #85844 by kath
Does it help if I pose my question in a different way?
;)

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

More
3 weeks 3 days ago #85845 by micker
hello sorry for delay but not sure to understand well
1 what is your output (html, custom php)?
2 fact in your field you can hide groupe is some fields are empty

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
3 weeks 3 days ago #85846 by kath
thanks for reading!
first of all, i just fixed my specific problem with a custom php trait in my custom template. but generally:

>> 1 what is your output (html, custom php)?

I use a custom MVC that sits on top of flexicontent. My Controller reads directly from e.g. $item->fields->value[2] (in a loop, to build a carousel).

problem here is:
while flexicontent's field->display_arr always has the correct lebgth (because empty values are filled with ""-values), it has formatted data.

But I want raw data, like in flexicontent's field->value.
That in turn only stores non-empty values.

My question was: can we an option to fill the field value array with some, say, null, if empty, instead ommitting the array element?

(Again, I helped myself in thsi case like this: php trait "fieldVal" -> function normalizeFieldValLength() -> compares above mentioned fields, and returns a value-array of correct length)

Hopefully I described the problem clearer now :)
Cheers,
Ben

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

More
3 weeks 3 days ago #85848 by micker
sorry for now i can't help you i no a coder
Georgios yes but need time

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
3 weeks 3 days ago #85850 by kath
no worries, 1) i fixed my case for now.
2) this was less a request for individual code, and more a question if this could be useful in a general, future, FC update.
Thanks for reading! :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.358 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline