title: TYPO3 – DCE extension: Get uids of current DCE instance and of section instance
body: <p>I am using Dynamic Content Elements (dce) in TYPO3 6.2 to build a Twitter Bootstrap accordion element.<br>
  To do so, I built an accordion DCE with a section element that stores all the accordion items.</p>
  
  <p>Now Bootstrap requires that I have a means of referencing the overall accordion instance from within each accordion item. (This is needed because there could be multiple accordions on the same page.)</p>
  
  <p>I found a way of doing that using {contentObject.uid}. This gives me the TYPO3 content element uid of the DCE, which is unique. It would be nicer to have some counter starting at 1 in each page. I guess, DCE holds something like that, but I have now clue how to access it.</p>
  
  <p>The real problem is that I also need a unique id for each accordion item within the overall accordion. There should be some section element uid in DCE, but again, I have now clue how it is named and how I can access it from the fluid template.</p>
  
  <p>Here is my current DCE fluid template:</p>
  
  <pre><code>{namespace dce=Tx_Dce_ViewHelpers}
  &lt;f:layout name="Default" /&gt;
  
  &lt;f:section name="main"&gt;
      &lt;div class="panel-group" id="accordion_{contentObject.uid}"&gt;
          &lt;f:for each="{field.accelement}" as="accordion-element"&gt;
              &lt;div class="panel panel-primary"&gt;
                  &lt;button type="button" class="btn btn-primary btn-block" data-toggle="collapse" data-parent="#accordion_{contentObject.uid}" data-target="#collapse_{accordion-element.uid}"&gt;{accordion-element.elheadline}&lt;/button&gt;
                  &lt;div id="collapse_{accordion-element.uid}" class="panel-collapse collapse"&gt;
                      &lt;div class="panel-body"&gt;
                          {accordion-element.elcontent}
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/f:for&gt;
      &lt;/div&gt;
  &lt;/f:section&gt;
  </code></pre>
  
  <p>The element that is not working is {accordion-element.uid}. I tried anything from {accordion-element.id} to {field.accelement.id} and {field.accelement.uid} – but no luck.</p>