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.

有帮助吗?

解决方案

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}}'"}}

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top