I'm stumped on one aspect of setting up MIGx for use with an accordion panel. There are two parts that I don't know how to construct. Each panel has a named anchor and a div with an id. How would I go about construction this portion in MIGx such that when the panel order is rearranged in the MIGx TV, those panel numbers change as well? Example: If I decided to move panel4 to be panel1, it's anchor & id becomes panel1. Same thing if I insert a new panel, a new number is generated, and all other panel numbers shift accordingly.
The chunk for each panel content is below. Trying for figure out how to set up the placeholder for the "#panel1", and the id="panel1
<dd class="accordion-navigation">
<a href="#panel1">[[+panelTitle]]</a>
<div id="panel1" class="content">
[[+panelDescription]]
</div>
</dd>
<dd class="accordion-navigation">
<a href="#[[+panelNumberPlaceholder]]">[[+panelTitle]]</a>
<div id="[[+panelNumberPlaceholder]]" class="content">
[[+panelDescription]]
</div>
</dd>
I guess I could also just use a placeholder for the numeral and hard code the text for the
#panel and
panel. But how do I get MIGx to auto insert the number and / or change that number to match it's position in the MIGx form?
a href="#panel[[
+placeholderForNumber]]"
id="#panel[[
+placeholderForNumber]]"
I found one post where it seemed as though the person had the ah-ha moment, figured it out, but never actually posted the final code. In that post..Bruno says: "A MIGX-id of a MIGX-item should never change its value. (Same as you would have records in a table with an autoincrementing primary key) If you need an idx starting from 1 when listing MIGX-records, use [[+idx]]"
So my question from a barely knowing enough to be dangerous perspective: What am I trying to do? What is the correct way to phrase the question for obtaining the solution.
Each item that gets created in MIGx, using Add Item, should be assigned a number — starting at 1
Those numbers should change whenever the item order is changed in the MIGx form. (whatever is in position 1 gets number 1, whatever is in position 2 gets number 2 and so on
Whatever that number is should then appear in the placeholder in my chunk source code (example: panel[[+number]]
[ed. note: mmcgee last edited this post 11 years, 10 months ago.]