CMS Development

sjay
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Is there any possibility to add an additional textbox in the page settings?

Résolue

Hi There,

Wanted to add an extra text box in the page settings for our internal purpose.

Is it possible?

0 Votes
1 Solution acceptée
Jake_Lett
Solution
Guide | Partenaire solutions
Guide | Partenaire solutions

Is there any possibility to add an additional textbox in the page settings?

Résolue

You could use the CMS API to get all of the pages and look for that data value https://developers.hubspot.com/docs/api/cms/pages#section-Site-Pages

 

If you are not familiar or comfortable using the API you could also try this.

  • Go to your website pages listing and make it show 100 pages.
  • Using chrome developer tools select the list of pages table inspect it and copy the HTML code
  • paste it into a text editor and select only the URLs - might need to use a regex for this. 
  • Look for href="/content-detail/[PORTAL ID]/site-page/[PAGE ID]/"
  • Create an array of all of these ID's
  • pass it to this loop hubl code. https://developers.hubspot.com/docs/cms/hubl/functions#content-by-ids - Each loop can have 100 id's and you can have 10 calls a page. 

If you have less than 50 pages you could also create a custom module with a pages field. Select the pages you want in a repeatable field. Then loop through it. Inside the loop, create your condition filter to show the pages with the widget value you need to check for.

 

Voir la solution dans l'envoi d'origine

6 Réponses
Jake_Lett
Solution
Guide | Partenaire solutions
Guide | Partenaire solutions

Is there any possibility to add an additional textbox in the page settings?

Résolue

You could use the CMS API to get all of the pages and look for that data value https://developers.hubspot.com/docs/api/cms/pages#section-Site-Pages

 

If you are not familiar or comfortable using the API you could also try this.

  • Go to your website pages listing and make it show 100 pages.
  • Using chrome developer tools select the list of pages table inspect it and copy the HTML code
  • paste it into a text editor and select only the URLs - might need to use a regex for this. 
  • Look for href="/content-detail/[PORTAL ID]/site-page/[PAGE ID]/"
  • Create an array of all of these ID's
  • pass it to this loop hubl code. https://developers.hubspot.com/docs/cms/hubl/functions#content-by-ids - Each loop can have 100 id's and you can have 10 calls a page. 

If you have less than 50 pages you could also create a custom module with a pages field. Select the pages you want in a repeatable field. Then loop through it. Inside the loop, create your condition filter to show the pages with the widget value you need to check for.

 

sjay
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Is there any possibility to add an additional textbox in the page settings?

Résolue

Can anyone help me on this?

0 Votes
sjay
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Is there any possibility to add an additional textbox in the page settings?

Résolue

@Jake_Lett  Jake: Any Idea?

 

Can I able to pull out the report based on value?

0 Votes
sjay
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Is there any possibility to add an additional textbox in the page settings?

Résolue

@Jake_Lett : Jake any Idea?

 

0 Votes
Jake_Lett
Guide | Partenaire solutions
Guide | Partenaire solutions

Is there any possibility to add an additional textbox in the page settings?

Résolue

This cannot be done. But you could create a custom module called "Page Settings" or "Advanced Page Settings" that would be found in the content tab. You would add that to to the template so it is baked into the page and unable to be removed using the drag and drop area.

 

You could also set one or all of the module fields as required in order for the page to be published.

sjay
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Is there any possibility to add an additional textbox in the page settings?

Résolue

Thanks, Jake.

In that way, Can I pull out the report based on the value?

For Ex: I have added a custom field(dropdown) with two values at a template level on all pages.

Can I able extract the report which pages have a particular value?

Hope you understand. Please let me know if you need further detail.

0 Votes