Joe Link Well-known member May 1, 2020 #1 How can we remove the XFMG album and comment search tabs from the search_form page?
K kick Well-known member May 1, 2020 #2 You must write an add-on that will overwrite the value for getSearchFormTab() Upvote 0 Downvote
Joe Link Well-known member May 1, 2020 #3 Thanks, that's what I figured but I was hoping there was an easier solution Upvote 0 Downvote
Chris D XenForo developer Staff member May 1, 2020 #4 If you absolutely have to, you can also modify the search_form template: HTML: <xf:foreach loop="$tabs" key="$tabType" value="$tab"> Change to: HTML: <xf:foreach loop="$tabs" key="$tabType" value="$tab" if="!in_array($tabType, ['xfmg_album', 'xfmg_comment'])"> (I haven't tested that but it looks right...) Upvote -1 Downvote
If you absolutely have to, you can also modify the search_form template: HTML: <xf:foreach loop="$tabs" key="$tabType" value="$tab"> Change to: HTML: <xf:foreach loop="$tabs" key="$tabType" value="$tab" if="!in_array($tabType, ['xfmg_album', 'xfmg_comment'])"> (I haven't tested that but it looks right...)
Joe Link Well-known member May 1, 2020 #5 Awesome, I'll give that a shot. Thanks Chris! Upvote 0 Downvote
Chris D XenForo developer Staff member May 1, 2020 #6 You reacted to my post very quickly. Just to note, I corrected a mistake, so take another look at the code before making the change Upvote 0 Downvote
You reacted to my post very quickly. Just to note, I corrected a mistake, so take another look at the code before making the change
K Kirby Well-known member May 1, 2020 #8 Yet another option (if hiding instead of removing would be acceptable) Code: html[data-template="search_form"] div.p-body-pageContent form[action="/search/search"] { & a[href="/search/?type=xfmg_album"], & a[href="/search/?type=xfmg_comment"] { display: none; } } in extra.less Upvote -1 Downvote
Yet another option (if hiding instead of removing would be acceptable) Code: html[data-template="search_form"] div.p-body-pageContent form[action="/search/search"] { & a[href="/search/?type=xfmg_album"], & a[href="/search/?type=xfmg_comment"] { display: none; } } in extra.less
Joe Link Well-known member May 1, 2020 #9 I try to remove the code rather than hiding whenever possible, but I do appreciate the suggestion Upvote 0 Downvote
PaulineK Member Feb 23, 2021 #10 Kirby said: Yet another option (if hiding instead of removing would be acceptable) Code: html[data-template="search_form"] div.p-body-pageContent form[action="/search/search"] { & a[href="/search/?type=xfmg_album"], & a[href="/search/?type=xfmg_comment"] { display: none; } } in extra.less Click to expand... Thanks, I used that code to remove the Search Resources button on the search form. Upvote 0 Downvote
Kirby said: Yet another option (if hiding instead of removing would be acceptable) Code: html[data-template="search_form"] div.p-body-pageContent form[action="/search/search"] { & a[href="/search/?type=xfmg_album"], & a[href="/search/?type=xfmg_comment"] { display: none; } } in extra.less Click to expand... Thanks, I used that code to remove the Search Resources button on the search form.
B Byga Member Apr 5, 2024 #11 Unfortunately, it didn't work in either of them. If I ask you, can you share the current code? Upvote 0 Downvote