Question

I'm a Pyro and CI noob, so sorry for any obvious omissions.

I'm building a site for a tour company. I've setup a stream with departure_locations and another with tours. Both have an assigned field called departure location name. I'm trying to output a list of tours under each location, but I can't figure out the where statement.

{{streams:departure_locations}}
  {{streams:tours where="`departure_location_name`='departure_location_name'"}}
    {{tour_name}}
  {{/streams:tours}}
{{/streams:departure_locations}}

I get a No Results from this though, even though there are definitely entries that should fit the where statement. Can anyone see where I've gone wrong? Thanks in advance.

I'm using PyroCMS v2.1.2. I've posted this in the PyroCMS forums as well.

Was it helpful?

Solution

Looks like I figured it out using the syntax from this post: http://www.pyrocms.com/forums/posts/view_reply/16409

{{streams:tours where="`departure_location_name`='{{departure_location_name}}'"}}

OTHER TIPS

I stacked this issue today and solved with include and include_by parameters like following:

{{ streams:tours include=departure_location_name include_by="departure_location_name" }}

Referred by PyroCMS Offical Document

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top