CMS Development

sjay
Member | Diamond Partner
Member | Diamond Partner

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

SOLVE

Hi There,

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

Is it possible?

0 Upvotes
1 Accepted solution
Jake_Lett
Solution
Guide | Partner
Guide | Partner

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

SOLVE

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.

 

View solution in original post

6 Replies 6
Jake_Lett
Solution
Guide | Partner
Guide | Partner

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

SOLVE

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
Member | Diamond Partner
Member | Diamond Partner

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

SOLVE

Can anyone help me on this?

0 Upvotes
sjay
Member | Diamond Partner
Member | Diamond Partner

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

SOLVE

@Jake_Lett  Jake: Any Idea?

 

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

0 Upvotes
sjay
Member | Diamond Partner
Member | Diamond Partner

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

SOLVE

@Jake_Lett : Jake any Idea?

 

0 Upvotes
Jake_Lett
Guide | Partner
Guide | Partner

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

SOLVE

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
Member | Diamond Partner
Member | Diamond Partner

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

SOLVE

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 Upvotes