coderedcorp/coderedcms

Customize form template

Closed this issue · 2 comments

This might be a bit of a stupid question, but I've looked and haven't been able to find the right solution.
I'm wanting to customize the template for displaying form fields on my website so that it adheres more closely to the brand identity.

One thing in particular is that the form field titles are shown in next to the field and in empty fields, which seems like overkill to me.

Is there a reasonably straightforward way to edit this that I've completely overlooked?

Thanks in advance

Absolutely. CRX uses normal Django templates, which means you can override the form page template and customize it.

In your project (assuming your app is called "website"), create the following file: website/templates/coderedcms/pages/form_page.html. You can alternatively create a completely different file, and specify that as the template variable on your FormPage model in website/models.py.

To start out, I'd recommend copying the contents of the CRX default form page template. Then you can modify it or completely re-write it as you see fit. https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/pages/form_page.html

By the way, this same process applies to virtually everything in CRX (navbar, blocks, page templates, miniview templates, etc.).

Thanks for your quick response (much quicker than my reply).
It looks like I've got what I was looking for, I think I was just being impatient with the CSS updates.