Hello. I am using a module on a dynamic page to display crm_objects. Of course there is the limit on how often on a page crm_objects can be used. How would I loop through to display them in batches? I assume I would use the has_more and offset but can't seem to get a loop working.
build into the template it should look something like this:
{% if dynamic_page_crm_object_type_fqn %} {# the listing page #}
{% set object = crm_objects(dynamic_page_crm_object_type_fqn, "limit=200","put, all, your, custom, object, properties, here") %}
{% for single_object in objects.results %}
<div class="object-wrapper">
<div class="names">
{{ single_object.put }} {{ single_object.all }} {{ single_object.your }}
</div>
</div class="something">
{{ single_object.your }} {{ single_object.custom }} {{ single_object.object }}
</div>
{% if single_object.properties == "here" %}
{{ single_object.here }}
{% endif %}
{% endfor %}
{% elif dynamic_page_crm_object %} {# the detail page #}
{# layout for detail page; you can use the objects set above or add more by adding a second "set object = ..." #}
{% endif %}
If you'd like to categorize the listing page you could add/use a property like a dropdown/select for this (see the if statement above)
About the pagination - have to test this.
But tbh, this seems to become something that you could easily use a blog for. Write your blog listing/post templates and put your CRM objects into them.
Also - custom objects were the topic of our october DHUG. You can watch it on YouTube
build into the template it should look something like this:
{% if dynamic_page_crm_object_type_fqn %} {# the listing page #}
{% set object = crm_objects(dynamic_page_crm_object_type_fqn, "limit=200","put, all, your, custom, object, properties, here") %}
{% for single_object in objects.results %}
<div class="object-wrapper">
<div class="names">
{{ single_object.put }} {{ single_object.all }} {{ single_object.your }}
</div>
</div class="something">
{{ single_object.your }} {{ single_object.custom }} {{ single_object.object }}
</div>
{% if single_object.properties == "here" %}
{{ single_object.here }}
{% endif %}
{% endfor %}
{% elif dynamic_page_crm_object %} {# the detail page #}
{# layout for detail page; you can use the objects set above or add more by adding a second "set object = ..." #}
{% endif %}
If you'd like to categorize the listing page you could add/use a property like a dropdown/select for this (see the if statement above)
About the pagination - have to test this.
But tbh, this seems to become something that you could easily use a blog for. Write your blog listing/post templates and put your CRM objects into them.
Also - custom objects were the topic of our october DHUG. You can watch it on YouTube
Hi, @LSeth👋 Thanks for your question. I'd like to invite a few community members to the conversation — hey @alyssamwilie@piersg@Anton, do you have any tips you can offer @LSeth?