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
Use radio buttons for selecting templates #3238
Use radio buttons for selecting templates #3238
Conversation
Codecov Report
@@ Coverage Diff @@
## page-template-choice-preview #3238 +/- ##
===============================================================
Coverage 33.05% 33.06%
- Complexity 8774 8775 +1
===============================================================
Files 663 664 +1
Lines 32454 32458 +4
===============================================================
+ Hits 10729 10733 +4
Misses 21725 21725
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
<input class="form-check-input" type="radio" name="templateRadios" id="templateRadio2" value="templateName2" checked> | ||
<label class="form-check-label" for="templateRadio2"> | ||
Template name <br> | ||
{% for template in form.templateId.children %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not show the visualisation of the template anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, this is done on line 301
<div class="template-visual-small"> | ||
{{ selectedTemplate.html|raw }} | ||
{{ template.vars.attr['data-html']|raw }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you add in in the attr field, does it then not also appear on as an attribute on the checkbox?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to create a custom form type and pass it like this https://github.com/forkcms/forkcms/blob/master/src/Backend/Form/Type/MetaType.php#L307 and then use the id of the template as key or something |
Type
Pull request description
Renders the template choices using radiobuttons