# How to create dynamic content extracted from static pages

**URL:** <https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342>\
**Category:** CMS Development\
**Created:** [March 1, 2022, 11:54am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342 "2022-03-01T11:54:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 1, 2022, 11:54am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/1 "2022-03-01T11:54:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oezcan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/oezcan/32/53959_2.png) [@Oezcan](https://community.hubspot.com/u/Oezcan)\
**Post date:** [March 1, 2022, 3:54pm UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/2 "2022-03-01T15:54:24Z")

</div>

Hello @JVallejo7

Do you mean this?

> **[Module and theme fields - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/fields/module-theme-fields)**
>
> HubSpot has many different field types, you can use to add flexibility and customization to your themes and modules.

> **[HubL functions - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/hubl/functions)**
>
> A reference listing of all of the available HubL functions.

> **[HubL functions - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/hubl/functions)**
>
> A reference listing of all of the available HubL functions.

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

 ![Oezcan_0-1646150035866.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/d/da3139a48105fbf8322ab048a8c6ef375b889422.png)

Best regards,

Özcan

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 3, 2022, 9:13am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/3 "2022-03-03T09:13:15Z")

</div>

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_0-1646298855596.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/c/6c949196a52ca2dc9c36943b45d8a5cf374170fc.png)

![JVallejo7_1-1646298876065.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/8/788896ed80d32b94b7ade5a53fc0a8eb7bfa96f8.png)

---

<div class="post-metadata">

**Author:** ![Oezcan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/oezcan/32/53959_2.png) [@Oezcan](https://community.hubspot.com/u/Oezcan)\
**Post date:** [March 3, 2022, 9:40am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/4 "2022-03-03T09:40:38Z")

</div>

Hello @JVallejo7

okay cool.

Then, try something like this as an example

```lia-code-sample
{% set my_content = content_by_id(module.page_field) %}
<p>{{my_content.title}}</p>

```

Best regards

Özcan

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 3, 2022, 9:49am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/5 "2022-03-03T09:49:24Z")

</div>

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

```lia-code-sample
{% set my_content = content_by_id(module.page_field) %}
<p>{{my_content.firstH1}}</p>

```

Thank

---

<div class="post-metadata">

**Author:** ![Oezcan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/oezcan/32/53959_2.png) [@Oezcan](https://community.hubspot.com/u/Oezcan)\
**Post date:** [March 3, 2022, 11:07am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/6 "2022-03-03T11:07:43Z")

</div>

Sure, but now comes some tricky part.

You can use some predefined HubSpot variables.

> **[HubL variables - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/hubl/variables)**
>
> HubSpot templates can use a host of predefined variables that can be used to render useful website and email elements. This page is a reference listing of those variables.

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

> **[HubL filters - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/hubl/filters)**
>
> HubL filter list and examples for HubSpot CMS developers.

Example:

```lia-code-sample
{% 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

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 3, 2022, 12:26pm UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/7 "2022-03-03T12:26:35Z")

</div>

THANK YOU SO MUCH

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 3, 2022, 12:37pm UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/8 "2022-03-03T12:37:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 1, 2022, 4:31pm UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/9 "2022-03-01T16:31:18Z")

</div>

@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](https://developers.hubspot.com/docs/cms/hubl/functions))

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

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [March 3, 2022, 9:17am UTC](https://community.hubspot.com/t/how-to-create-dynamic-content-extracted-from-static-pages/52342/10 "2022-03-03T09:17:01Z")

</div>

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