XF 2.2 Disable search popup for guests only?

eva2000

Well-known member
Hi what would be the best way to go about disabling the header's search click pop up only for guest visitors so that clicking search link will redirect guest visitors only to to /search URL path?

cheers

George
 
This seems to work but best way ?

in PAGE_CONTAINER

for
Code:
            <a href="{{ link('search') }}"
              class="p-navgroup-link p-navgroup-link--iconic p-navgroup-link--search"
              data-xf-click="menu"
              data-xf-key="{{ phrase('shortcut.search_menu')|for_attr }}"
              aria-label="{{ phrase('search')|for_attr }}"
              aria-expanded="false"
              aria-haspopup="true"
              title="{{ phrase('search')|for_attr }}">
              <i aria-hidden="true"></i>
              <span class="p-navgroup-linkText">{{ phrase('search') }}</span>
            </a>
change to so data-xf-click="menu" is only shown for members not guests
Code:
            <a href="{{ link('search') }}"
              class="p-navgroup-link p-navgroup-link--iconic p-navgroup-link--search"
              <xf:if is="$xf.visitor.user_id">
                data-xf-click="menu"
              </xf:if>
              data-xf-key="{{ phrase('shortcut.search_menu')|for_attr }}"
              aria-label="{{ phrase('search')|for_attr }}"
              aria-expanded="false"
              aria-haspopup="true"
              title="{{ phrase('search')|for_attr }}">
              <i aria-hidden="true"></i>
              <span class="p-navgroup-linkText">{{ phrase('search') }}</span>
            </a>
 
Back
Top Bottom