CMS Development

kk
Member

Custom fields for coded templates

SOLVE

Is there a way to allow/add the same sort of custom fields (text, rich text, choice, boolean, image) that are available for custom modules?

0 Upvotes
1 Accepted solution
Jsum
Solution
Key Advisor

Custom fields for coded templates

SOLVE

just use a text module and set no_wrapper to true:

{% text "iframe_url" label="Iframe URL", no_wrapper=True %}

Just place this as the src value and you can paste the url into the field that shows up in the page editor.  Be mindful of the quotations, you can change the ones above to single quotes, or you singles around the src value.

View solution in original post

0 Upvotes
4 Replies 4
Jsum
Key Advisor

Custom fields for coded templates

SOLVE

@kk,

 

I'm not quite sure what you are asking here. You can't use custom module tokens outside of the custom module builder, but...

 

What I think you are wanting to do is take a coded template page and make it editable(?). If so then yes, it is not only possible but pretty easy. You can use HubL. Look at the available modules in HubL and replace your static content for those editable fields. Just be mindful of nesting quotations. 

0 Upvotes
kk
Member

Custom fields for coded templates

SOLVE

Thanks @Jsum. I did sorta of look at the HubL but I wasn't sure how I could make a portion editable.

Basically I'm trying to create a template with an iframe, where the iframe source is what would change from page to page. Currently I've just been duplicating the coded template and pasting the url manually. I would love to have that src url be editable by anyone who references that same template.

0 Upvotes
Jsum
Solution
Key Advisor

Custom fields for coded templates

SOLVE

just use a text module and set no_wrapper to true:

{% text "iframe_url" label="Iframe URL", no_wrapper=True %}

Just place this as the src value and you can paste the url into the field that shows up in the page editor.  Be mindful of the quotations, you can change the ones above to single quotes, or you singles around the src value.

0 Upvotes
kk
Member

Custom fields for coded templates

SOLVE

@Jsum Ah ha, I understand now. Thank you so much!

0 Upvotes