CMS Development

ben-duchy
Top Contributor

Dynamic page with external module filter

I've started looking into the potential that dynamic pages has to offer as up to this point I've been creating multiple (similar) pages with simple filters on the module. 

 

Having now cracked how to create dynamic pages to a simple level, my question is, how do I add in an external module on a that acts as a filter?

 

This is what I have currently:

 

<!-- Row landing page -->
{% if dynamic_page_hubdb_row %}      
  <h1>{{ dynamic_page_hubdb_row.site.name }}</h1>
  <h2>Plot: {{ dynamic_page_hubdb_row.plot_no }}</h2>
  <h3>The {{ dynamic_page_hubdb_row.house_type }}</h3>
    
<!-- Top level landing page - link list -->
{% elif dynamic_page_hubdb_table_id %}
  {% for row in hubdb_table_rows(dynamic_page_hubdb_table_id) %}
    {% if row.plot_status.name == "Reserved" %}
      <p><a href="{{ request.path }}/{{ row.hs_path }}">
        Site: {{ row.site.name }}<br>
        plot: {{ row.plot_no }}</a></p>  
    {% endif %}
  {% endfor %}
    
{% endif %}

 

 

You will see that I have added an if condition filter to only show 'Reserved' plots.

 

I have now created an external module that allows you to select different statuses such as 'Sold' etc, but how do I embed this into the code above that replaces the existing 'Reserved' filter?

 

{% module "module_xxxxxx" path="/Custom modules/Website/dynamic_modules", label="dynamic_modules" %}

 

 

0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Dynamic page with external module filter

Hi, @ben-duchy 👋 Let's see if we can get the converstaion going for you. Hey, @Kevin-C @Anton @Teun, do you have any hard-won experience to share with @ben-duchy?

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes