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

2 years 7 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:
<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 ...

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.

2 years 7 months ago #63585 by ggppdk

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

in the short term to do (next days)

-- 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 review. Thanks!

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

2 years 7 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
© 2018 Flexicontent. All Rights Reserved.