Fieldgroup HTML display: array index / position of current value in multi-value group / auto increment value

More
7 years 8 months ago #63561 by othbert
Hi there,

I wish to use a fieldgroup to create an accordion style element. For this, as I'll be using a standard library rather than writing my own, I would like to be able to access the current position in the array of grouped values, but haven't found a way other than creating an extra field (that the site admin would have to populate themselves) to hold an integer (that they would also need to ensure is unique).

The custom HTML display I have so far for the group is based on the Foundation front-end framework, and is as follows:
Code:
<li class="accordion-navigation"> <a href="#panel{{xxx}}" role="tab" id="panel{{xxx}}-heading" aria-controls="panel{{xxx}}">{{accordion_heading}}</a> <div id="panel{{xxx}}" class="content" role="tabpanel" aria-labelledby="panel{{xxx}}-heading"> ... a bunch of fields in here ... </div> </li>

Here {{xxx}} is where I would need a unique non-whitespace value. I have tried some combinations of {{accordion_heading##id}} (which sort of gave me results, though not the ones I was expecting), valueorder, index, autoincrement... etc. I also had a look through the onFieldDisplay method for a text field to see if I could find where I would need to add a custom method if I was to duplicate it and go that route, but I thought I would ask you guys first because you're always so good with the support! :)

Many thanks as always for the great software!

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

More
7 years 8 months ago #63585 by ggppdk
Hello

yes a value count number is areplacement should have been added in the first place

in the short term to do (next days)
github.com/FLEXIcontent/flexicontent-cck/issues/612


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: othbert

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

More
7 years 8 months ago #63598 by othbert
Thanks, that's great!

I changed for a newer version of foundation which doesn't rely on indexed accordion items, but there are other places in the site that I require it, so this would still be useful to see :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.258 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