How to create dynamic content extracted from static pages

I want to create a custom module like blog listing but instead extract the dynamic content from a blog, I want to extract dynamic content from a static page.

is it possible?

THX

Hello @JVallejo7

Do you mean this?

You also have the option of adding a page field to add fields

Best regards,

Özcan

Yes! But i want the title and a summary. I think this only received and ID and the title.

You can look in these images:

JVallejo7_1-1646298876065.png

Hello @JVallejo7

okay cool.

Then, try something like this as an example

{% set my_content = content_by_id(module.page_field) %}
<p>{{my_content.title}}</p>

Best regards

Özcan

That’s ok, but can I get some extra content like the first h1 of this page ?

{% set my_content = content_by_id(module.page_field) %}
<p>{{my_content.firstH1}}</p>

Thank

Sure, but now comes some tricky part.

You can use some predefined HubSpot variables.

And, if you want to see additional information what these variables can output, you have to use pprint.

Example:

{% set my_content = content_by_id(module.page_field) %}
<p>{{my_content|pprint}}</p>

This will print you a json object, with keys and values. Each key/value pair is separated by a comma.

I hope this can help you

Best regards,

Özcan

THANK YOU SO MUCH

Is there another type of pprint that shows JSON pretty to testing ?
Thanks

@JVallejo7

Could you add some more details about what you are trying to accomplish. There are several functions that will pull blog content into a module (You can find a list of them here)

@Anton is a pretty smart fellow who might be able to help if you have more info

Thanks. Oezcan understands me. Sorry, my English is a little bit poor