wvuweb / hammer

A tool for CleanSlate theme development
https://cleanslate.wvu.edu
4 stars 2 forks source link

Add support for the r loop index tag #46

Closed adamjohnson closed 8 years ago

adamjohnson commented 8 years ago

Here's the relevant commit:

https://github.com/wvuweb/cleanslate/commit/f80c085fbd191f868a006c24e73bba6c2429506d

Tag:

<r:loop:index />

<ul role="tablist" class="wvu-tabs__list">
  <r:loop items="Default, Science and Engineering, Business, Creativitiy and Communication, Social Sciences, Education, Health, Undecided">
    <r:each>
      <li class="wvu-tabs__list-item" role="presentation">
        <a aria-selected="false" id="tab-<r:index />" class="wvu-tabs__list-link" aria-controls="panel-<r:item />" role="tab" data-tab="<r:item />" data-panel="admitted-tab__transfer" href=""><r:item /></a>
      </li>
    </r:each>
  </r:loop>
</ul>

Using this on the new Academics template in the Admissions theme. Ties tabs to their relevant tab content via aria labels.

adamjohnson commented 8 years ago

Example 2:

http://ateam.sandbox.wvu.edu/demos/logic-looping

adamjohnson commented 8 years ago

Implemented in https://github.com/wvuweb/hammer/commit/bf0e620041b83d1322970c918b5dc62bf2ae8dbf. Thanks Steve.

zeroedin commented 8 years ago

Thanks for closing forgot to in the commit.

adamjohnson commented 8 years ago

Nathan changed this tag to start at 1 instead of 0. Can you update hammer so that these tags output the same thing?

Here's his commit:

https://github.com/wvuweb/cleanslate/commit/f1eecbe9ea27db94358710fa01a935b440b061f4

Here's your hammer commit:

https://github.com/wvuweb/hammer/commit/bf0e620041b83d1322970c918b5dc62bf2ae8dbf

I can submit a pull request for this one if you'd like.

zeroedin commented 8 years ago

Closed by wvuweb/hammer@a90bdcee47b15f4aa997d8b490e48ae34e70c549