wvuweb / hammer

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

Implement r:page:descendants tag #15

Closed adamjohnson closed 9 years ago

adamjohnson commented 9 years ago

Here's the code from the CleanSlate site for recently updated pages:

<r:get_page id="1819">
  <ul class="u-list__chevron">
    <r:page:descendants:each by="created_at" order="desc" limit="5">
      <li><a href="<r:page:url />"><r:page:name /></a></li>
    </r:page:descendants:each>
  </ul>
</r:get_page>

and another code example:

<r:get_page id="1819">
  <r:page:descendants:each by="created_at" order="desc" limit="5">
    <r:page:name />
  </r:page:descendants:each>
</r:get_page>
zeroedin commented 9 years ago

Hammer doesn't have a concept of pages. You will never be able to do either of these snippets.

This is an advanced snippet unfortunately that heavily relies on content. Specifically page content that can not be "mocked" without a stupid amount of data in the mock_data.yml. Not worth it for the development cycle.

What do you want to display instead?

Custom message content block maybe under get_page: key?

Example:

get_page: |
  <ul>
    <li>This content</li>
    <li>This stuff too</li>
  </ul>
adamjohnson commented 9 years ago

Yeah I just want to be able to throw some plain text or HTML at this tag. Nothing fancy.

adamjohnson commented 9 years ago

Another usage example just in case anyone needs a reference:

https://stash.development.wvu.edu/projects/CST/repos/cleanslate-site/browse/mock_data.yml?until=c116b7926b35068891f60baf9b9620af739a9c23#118