Can I set the "Make Poll Public" option as default? I have been getting questions about how to change this when users have already made the poll, so i'm assuming they are not reading the options, and not checking "Make Poll Public" when my users post a poll, so i'd like to just set it as default. Thank you!!!
Announcement
Collapse
No announcement yet.
Set Make Poll Public as Default?
Collapse
X
-
Do you mean the 'Make Votes Public' checkbox? If so, edit the 'contententry_panel_poll' template and change this line (should be line 35):
Code:<label class="b-form-control__label"><input type="checkbox" name="public" class="b-form-control__control" value="1"<vb:if condition="$conversation['public']"> checked="checked"</vb:if> tabindex="0" /><span class="b-form-control__text">{vb:phrase make_votes_public}</span></label>
Code:<label class="b-form-control__label"><input type="checkbox" name="public" class="b-form-control__control" value="1"<vb:if condition="$conversation['public']"> checked="checked"</vb:if> tabindex="0" checked /><span class="b-form-control__text">{vb:phrase make_votes_public}</span></label>
-
Originally posted by Trevor Hannant View PostDo you mean the 'Make Votes Public' checkbox? If so, edit the 'contententry_panel_poll' template and change this line (should be line 35):
Code:<label class="b-form-control__label"><input type="checkbox" name="public" class="b-form-control__control" value="1"<vb:if condition="$conversation['public']"> checked="checked"</vb:if> tabindex="0" /><span class="b-form-control__text">{vb:phrase make_votes_public}</span></label>
Code:<label class="b-form-control__label"><input type="checkbox" name="public" class="b-form-control__control" value="1"<vb:if condition="$conversation['public']"> checked="checked"</vb:if> tabindex="0" checked /><span class="b-form-control__text">{vb:phrase make_votes_public}</span></label>
The better solution should be to only set it to public if $conversation is null which occurs when you are just starting a poll topic and not when you're editing an existing poll topic.
Code:<vb:if condition="empty($conversation)"> {vb:set conversation.public, 1} </vb:if>
But the best solution is to create a template hook and to not modify the existing templates at all for maintenance reasons (as the change may be overwritten or cause merge conflict that you have to resolve every time you upgrade). The template hook location should be 'editor_additional_panels' and the template code is:
Code:<script> (function() { document.addEventListener('DOMContentLoaded', function(){ var publicCheckbox = document.querySelector('.new-content-widget .b-content-entry-panel__content--poll .b-form-control__control[name="public"]'); if (publicCheckbox) { publicCheckbox.checked = true; } }); })(); </script>
Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment