XF 2.2 forum_edit template change (2.2)

Lawrence

Well-known member
Working on adding a new option to the forum_edit template I noticed that the <checkboxrow> is now given a rowid in XF 2.2: <xf:checkboxrow rowid="advancedToggles">. What is the purpose of the id? I cannot find one. What I want to do is add a numberbox just below the moderate new replies option, and to do so I will need to close out the checkboxrow, insert my option, then add in a new checkboxrow tag, but not sure about the rowid for the new checkboxrow that will house the remaining options. Any insight is welcomed.

Thanks
 
Solution
I'm not sure if this is the right forum for it, but the feedback forum certainly isn't, IMO.

Anyway, the ID was added because the XFES add-on needs to do a template modification to inject an additional checkbox there and adding an ID to it looks like it was the simplest way of achieving that.
Most of the row prefixed attributes for row suffixed tags are targeted towards the dl.formRow.

For example, if you were to use something like this:
HTML:
<xf:checkboxrow name="input_name_goes_here" id="ctrl_input_name_goes_here">
    <xf:option value="value_a" label="{{ phrase('myAddOn_phrases.value_a') }}" />
    <xf:option value="value_b" label="{{ phrase('myAddOn_phrases.value_a') }}" />
</xf:checkboxrow>
Then the ctrl_input_name_goes_here will be used as the ul.inputChoices which is inside dl.formRow > dd.

But if you were to use id attribute row suffixed tags on such as <xf:selectrow /> and <xf:formrow /> that doesn't really support "lists" similar to how <xf:radiorow /> and <xf:checkboxrow /> does then you would see the value of id attribute is applied to the dl.formRow itself.

Now if you want to apply id to the dl.formRow, ul.inputChoices and finally each checkbox/radio then you would use something like this:
HTML:
<xf:checkboxrow name="input_name_goes_here" rowid="this_id_is_applied_to_dl_formrow" id="this_id_is_applied_to_ul_input_choices">
    <xf:option value="value_a" label="{{ phrase('myAddOn_phrases.value_a') }}" id="this_id_is_applied_to_value_a_checkbox" />
    <xf:option value="value_b" label="{{ phrase('myAddOn_phrases.value_a') }}" id="this_id_is_applied_to_value_b_checkbox" />
</xf:checkboxrow>
which will be rendered as:
HTML:
<dl class="formRow" id="this_id_is_applied_to_dl_formrow">
   <dt>
      <div class="formRow-labelWrapper"></div>
   </dt>
   <dd>
      <ul class="inputChoices" id="this_id_is_applied_to_ul_input_choices">
         <li class="inputChoices-choice"><label class="iconic"><input type="checkbox" name="input_name_goes_here[]" value="value_a" id="this_id_is_applied_to_value_a_checkbox"><i aria-hidden="true"></i><span class="iconic-label">myAddOn_phrases.value_a</span></label></li>
         <li class="inputChoices-choice"><label class="iconic"><input type="checkbox" name="input_name_goes_here[]" value="value_b" id="this_id_is_applied_to_value_b_checkbox"><i aria-hidden="true"></i><span class="iconic-label">myAddOn_phrases.value_a</span></label></li>
      </ul>
   </dd>
</dl>
.

A very similar technique is applied to <xf:datarow /> (or was it <xf:cell>?).

Now playing: Don't Sweat The Technique - Eric B & Rakim
 
I wonder why this was moved to the styles and customisation questions forum when I am asking why in 2.2 the forum_edit template was changed to add an id to the <checkboxrow> tag under advanced options, @Chris D. I would like to know the purpose of this change. This is not a styling question.

Thanks @TickTackk for your response, always appreciated. I'm referring to just the <checkboxrow> tag, in 2.1 it was just left as that, in 2.2 it is now changed to <xf:checkboxrow rowid="advancedToggles">, curious as to why, :)
 
I'm not sure if this is the right forum for it, but the feedback forum certainly isn't, IMO.

Anyway, the ID was added because the XFES add-on needs to do a template modification to inject an additional checkbox there and adding an ID to it looks like it was the simplest way of achieving that.
 
Solution
Thank-you @Chris D, makes sense :) I asked because I want to add a numberbox just under moderate new replies checkbox, and to do that without closing that <checkboxrow> (and then opening a new one for the remainder of the forum checkbox options) it is going to throw an error. I just wanted to be sure my template modification will not break anything. If this doesn't seem like a good approach, I'll need to add it by itself below the </checkboxrow>, but it will be out of place as it is for the length of time to moderate new replies in that forum.
 
Back
Top Bottom