Korsch
Member
Im looking for little insight and guidance into a project im working on, Im using the Xenforo Homepage add-on and im trying to set it up as a landing page with some links. For example if a user has not been logged in or isn't registered they are presented with Forums, Login, and Register. If a user has been logged in already they're presented with Forums, Account and Logout.
Ive worked it out so all links are working as intended, but I want to streamline the whole thing by having the login link presenting the user with the Login Overlay that would be presented within the forum.
Currently this is what my homepage links look like now, ive tried a few options like adding the login javascript file ( /js/xf/login_signup.js )
with
and
with no luck. so I guess my next question is if this is really possible?
Thanks everyone!
Ive worked it out so all links are working as intended, but I want to streamline the whole thing by having the login link presenting the user with the Login Overlay that would be presented within the forum.
HTML:
<div class="user-links">
<xf:if is="{$xf.visitor.user_id}">
<a href="{{ link('forums', '', { 'csrf': 'true' }) }}">Forums</a> |
<a href="{{ link('account') }}">Account</a> |
<a href="{{ link('logout', null, {'t': csrf_token()}) }}" class="menu-linkRow">{{ phrase('log_out') }}</a>
<xf:else />
<a href="{{ link('forums', '', { 'csrf': 'true' }) }}">Forums</a> |
<a href="{{ link('login') }}">Log In</a> |
<a href="{{ link('register') }}">Register</a>
</xf:if>
Currently this is what my homepage links look like now, ive tried a few options like adding the login javascript file ( /js/xf/login_signup.js )
with
HTML:
<a id="custom-login-link" href="#" class="button">Login</a>
JavaScript:
<script>
document.getElementById('custom-login-link').addEventListener('click', function(e) {
e.preventDefault();
XF.login();
});
</script>
Thanks everyone!