List Info

Thread: Liquid template question:child_sections, variables, and nesting




Liquid template question:child_sections, variables, and nesting
user name
2006-11-18 06:11:14
Hello,

The new nested section feature is great.  Another reason to
like
Mephisto.

I am trying to use feature in a template that returns
articles by state
but need a little help with the liquid.

Currently, I am using the following liquid to return a list
of state
"children" on the overview page.

{{ 'states' | child_sections | assign_to: 'var_states' }}
{% for section in var_states %}
  <p>{{ section | link_to_section }}</p>
{% endfor %}

I would like to add a list of article titles and links on
this page. I
am a little confused with the nesting logic.  Where would I
place the
article link code in the above example to achieve the
article links?

states(section)
         texas(child_sections) --Article count if possible--
                 article title with article link(for
everylink in texas
section)
         ohio(child_sections)
                 article title with article link(for
everylink in texas
section)

I tried variations of {% for article in section.articles %}
or {% for
articles in var_states %}, etc.

Any help would be appreciated.  I think this would make a
good how
to/recipe.

Thanks,

Bryan


--~--~---------~--~----~------------~-------~--~----~
Mephisto: http://mephistoblog.com |
Mephisto Help: http://mephisto.stikipad
.com

To post to this group, send email to MephistoBloggooglegroups.com
To unsubscribe from this group, send email to
MephistoBlog-unsubscribegooglegroups.com
For more options, visit this group at http
://groups-beta.google.com/group/MephistoBlog
-~----------~----~----~----~------~----~------~--~---

Liquid template question:child_sections, variables, and nesting
user name
2006-11-21 23:16:45
Rick,

Am I using the child_sections as intended?  Should you be
able to
access the same set of variables in the nested sections as
are availble
using the standard section?

Thanks,

Bryan

On Nov 17, 11:11 pm, "haccont...yahoo.com"
<haccont...yahoo.com>
wrote:
> Hello,
>
> The new nested section feature is great.  Another
reason to like
> Mephisto.
>
> I am trying to use feature in a template that returns
articles by state
> but need a little help with the liquid.
>
> Currently, I am using the following liquid to return a
list of state
> "children" on the overview page.
>
> {{ 'states' | child_sections | assign_to: 'var_states'
}}
> {% for section in var_states %}
>   <p>{{ section | link_to_section }}</p>
> {% endfor %}
>
> I would like to add a list of article titles and links
on this page. I
> am a little confused with the nesting logic.  Where
would I place the
> article link code in the above example to achieve the
article links?
>
> states(section)
>          texas(child_sections) --Article count if
possible--
>                  article title with article link(for
everylink in texas
> section)
>          ohio(child_sections)
>                  article title with article link(for
everylink in texas
> section)
>
> I tried variations of {% for article in
section.articles %} or {% for
> articles in var_states %}, etc.
>
> Any help would be appreciated.  I think this would make
a good how
> to/recipe.
> 
> Thanks,
> 
> Bryan


--~--~---------~--~----~------------~-------~--~----~
Mephisto: http://mephistoblog.com |
Mephisto Help: http://mephisto.stikipad
.com

To post to this group, send email to MephistoBloggooglegroups.com
To unsubscribe from this group, send email to
MephistoBlog-unsubscribegooglegroups.com
For more options, visit this group at http
://groups-beta.google.com/group/MephistoBlog
-~----------~----~----~----~------~----~------~--~---

Liquid template question:child_sections, variables, and nesting
user name
2006-11-21 23:22:40
On 11/21/06, haccontactyahoo.com <haccontactyahoo.com> wrote:
>
> Rick,
>
> Am I using the child_sections as intended?  Should you
be able to
> access the same set of variables in the nested sections
as are availble
> using the standard section?


{% for article in section.articles %} is correct.  Since you
named
your section var_states, you'd use:

{% for article in var_states.articles %}


-- 
Rick Olson
http://weblog.techno-
weenie.net
http://mephistoblog.com

--~--~---------~--~----~------------~-------~--~----~
Mephisto: http://mephistoblog.com |
Mephisto Help: http://mephisto.stikipad
.com

To post to this group, send email to MephistoBloggooglegroups.com
To unsubscribe from this group, send email to
MephistoBlog-unsubscribegooglegroups.com
For more options, visit this group at http
://groups-beta.google.com/group/MephistoBlog
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )