TangibleInc / template-system

A template system for WordPress with content type loops and conditions
https://docs.loopsandlogic.com/reference/template-system/
8 stars 3 forks source link

If tag: Add attribute `location` to match location rules to global query context #120

Open eliot-akira opened 4 months ago

eliot-akira commented 4 months ago

Mentioned in L&L Forum: Global query context.

..the feature called Locations, which is part of the template type Layout. It’s a way to match a set of location rules to the global query, to determine which layout template to load.

These rules have the same structure as conditional rules for the If tag, with subject, operator, value. So it might be possible to add a new attribute location that uses this function to evaluate a given location rule. It could look like…

<If location=search>
  Search result
<Else if location=archive />
  Post archive
</If>