XF 1.4 Customizing default selections in Move Thread/Move Post

Wildcat Media

Well-known member
This is the Move Thread dialog:

upload_2015-2-5_11-10-31.webp

We want Redirection Notice to default to "Do not leave a redirect," and the two Notify checkboxes to be unchecked. I had thought of doing this via template edits, but upon looking, there is code there that seems to control it, as opposed to the HTML simply using SELECTED or CHECKED.

Is there any way to do this easily?
 
Edit the inline_mod_thread_helper_redirect template like so:

HTML:
<ul>
    <li><label for="ctrl_create_redirect_none"><input type="radio" name="create_redirect" value="" id="ctrl_create_redirect_none" checked="checked" /> {xen:phrase do_not_leave_redirect}</label></li>
    <li><label for="ctrl_create_redirect_permanent"><input type="radio" name="create_redirect" value="permanent" id="ctrl_create_redirect_permanent" /> {xen:phrase leave_permanent_redirect}</label></li>
    <li><label for="ctrl_create_redirect_expiring"><input type="radio" name="create_redirect" value="expiring" id="ctrl_create_redirect_expiring" class="Disabler" /> {xen:phrase leave_redirect_that_expires_after}:</label>
        <ul id="ctrl_create_redirect_expiring_Disabler">
            <li>
                <input type="text" size="5" name="redirect_ttl_value" value="1" class="textCtrl autoSize" />
                <select name="redirect_ttl_unit" class="textCtrl autoSize">
                    <option value="hours">{xen:phrase hours}</option>
                    <option value="days" selected="selected">{xen:phrase days}</option>
                    <option value="weeks">{xen:phrase weeks}</option>
                    <option value="months">{xen:phrase months}</option>
                </select>
            </li>
        </ul>
    </li>
</ul>

Essentially, move checked="checked" from the expiring option to the no redirect option.

Just noticed the other questions.

For the forum watching, edit the inline_mod_thread_move template and remove {xen:checked '{$threadCount} == 1'}.

For the thread started, edit the helper_thread_mod_action_alert template and remove {xen:checked $alertDefault}.
 
Edit the inline_mod_thread_helper_redirect template like so:

That should work nicely--I was not certain where that was located.

I was also not sure of how the {xen:checked ...} code worked and was reluctant to change or move it.

Does the "move post" dialog use similar coding? IF so, I can figure that out.

Thanks much!
 
For the forum watching, edit the inline_mod_thread_move template and remove {xen:checked '{$threadCount} == 1'}.

The other edits worked like a charm! This one, however, still results in the box being checked after removing the {xen:checked...} phrase as shown. (This was for "Notify members watching the destination forum.")

upload_2015-2-5_15-17-34.webp
 
Are you using the inline mod or the thread tools dropdown?

The latter uses the thread_move template, so you will also need to edit that and remove the checked="checked".
 
Oh, OK, that explains it. We actually use both in about equal numbers, so everything has been helpful. I saw the thread_move template earlier--I'll edit that one and we should be all set.

Thanks much!
 
I love that I found this thread!

Ok, so I not only found how and where to change the default selection, but also the default time!

I wanted 1 hour vs. 1 day, so:

Code:
                   <option value="hours">{xen:phrase hours}</option>
                   <option value="days" selected="selected">{xen:phrase days}</option>

is now:

                   <option value="hours" selected="selected">{xen:phrase hours}</option>
                   <option value="days">{xen:phrase days}</option>
 
... and for defaulting to no redirect and also having the option for 1 hour defaulted, you put this:

Code:
<ul>
    <li><label for="ctrl_create_redirect_none"><input type="radio" name="create_redirect" value="" id="ctrl_create_redirect_none" checked="checked" /> {xen:phrase do_not_leave_redirect}</label></li>
    <li><label for="ctrl_create_redirect_permanent"><input type="radio" name="create_redirect" value="permanent" id="ctrl_create_redirect_permanent" /> {xen:phrase leave_permanent_redirect}</label></li>
    <li><label for="ctrl_create_redirect_expiring"><input type="radio" name="create_redirect" value="expiring" id="ctrl_create_redirect_expiring" class="Disabler" /> {xen:phrase leave_redirect_that_expires_after}:</label>
        <ul id="ctrl_create_redirect_expiring_Disabler">
            <li>
                <input type="text" size="5" name="redirect_ttl_value" value="1" class="textCtrl autoSize" />
                <select name="redirect_ttl_unit" class="textCtrl autoSize">
                    <option value="hours" selected="selected">{xen:phrase hours}</option>
                    <option value="days">{xen:phrase days}</option>
                    <option value="weeks">{xen:phrase weeks}</option>
                    <option value="months">{xen:phrase months}</option>
                </select>
            </li>
        </ul>
    </li>
</ul>
 
A follow-up question: What if I want to default the checkbox for "Notify thread starter of this action. Reason:" to checked AND also default the text in the text box to something like "Moved to a more appropriate forum section"?
 
Back
Top Bottom