Location guides

Location guides provide collective information about locations and areas. This information can be in the form of local branches, geographical location information, location specific content and so on. A useful way to think of a node is as an aggregator of content to be displayed on (for example) a location property results page.

A route exists in the Ctesius app to location guide pages, this means you can begin to build up content for individual locations. The route for this page is:

/location_guides
/location_guides/:location

Within your theme, you will need to add a location_guides folder and within it, an index.liquid and a show.liquid file. This file will contain all of the node blocks you require to pull out content chunks, branch information, properties and so on.

On the index page you can display all the nodes of type location guide in a loop like this

  {% for node in nodes %}
    The title is: {{node.title}}
  {% endfor %}

For instance, if a branch served the town of ‘Tamworth’, you might create a Tamworth node, with the slug ‘tamworth’. You could then get to it using /location_guides/tamworth.

You can define Location guide nodes in the backend which can have multiple node items (of a range of data types - i.e. Branch, Location, Property etc) that can pull in various data objects from within the Homeflow system. This can be used to help build up the complex requirements of a Location guide page. For more information on nodes click here.

Location guide show

On the location guide show page you can access all the node items for that node (which remember is what a location guide is).

You can call a node with either or as they are one in the same thing, however note that the with_node block (mentioned below) expects hf_node to be passed into it - this is due to liquid markup also using the variable ‘node’ so things get confused and sad in our rendering engine.

You can access the node items of a specific type by using the with_node block helper like so:

{% with_node hf_node, type: sitecontentchunk, name: hero_intro  %}
  {% for node_item in node_items %}
   <p>{{node_item.content}}</p>
  {% endfor %}
{% endwith_node %}

For more information on nodes click here.