Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override default template #48

Open
mitogh opened this issue May 2, 2016 · 5 comments
Open

Override default template #48

mitogh opened this issue May 2, 2016 · 5 comments

Comments

@mitogh
Copy link
Member

mitogh commented May 2, 2016

At the moment by default content:

  • forms
  • headers
  • footer

Each uses his own div we should update this in order to make it more pluggable by allowing the override of the default structure of the form.

Related with #41

@adamf321
Copy link
Contributor

adamf321 commented May 2, 2016

I did discuss with Andres the possibility of overriding directive templates in the app's folder. This would apply to all components, not just gforms.

@mitogh
Copy link
Member Author

mitogh commented May 3, 2016

Ok. But I think we need some kind of solutions similar to the way filters works in order to be more easy to update.

On May 2, 2016, at 6:24 PM, Adam Fenton [email protected] wrote:

I did discuss with Andres the possibility of overriding directive templates in the app's folder. This would apply to all components, not just gforms.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #48 (comment)

@chrisweight
Copy link
Collaborator

chrisweight commented May 3, 2016

At the moment the GForm template has a hardcoded base-template in the form HTML parsers for the form layout and the HTML to show an error if the form doesn't load from API properly.

These could be extracted into a separate file and loaded when the component bootstraps, that would enable you to customize the main templates when you work out how, though the form item rendering is currently all done in code, so you would still get a <ul> of form elements.

@mitogh
Copy link
Member Author

mitogh commented May 3, 2016

Thanks for the information. Yes we need a way to be able to overwrite this kind of templates on some scenarios or specific forms.

@adamf321
Copy link
Contributor

adamf321 commented May 3, 2016

The main thing is to be able to override individual form controls - e.g. to add the select-ul attribute directive, or add a class to an input so it renders differently form the default.

This should be tied in with patternlab. So taking the 2nd example - say we have 2 types of submit inputs (buttons) in our app - default and small. These 2 should be registered with patternlab as per normal, then we need a way of telling gforms which to use for a given form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants