1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using the "Sign Up Now!" Button in a Notice

Discussion in 'XenForo Questions and Support' started by toodlez, Nov 6, 2011.

  1. toodlez

    toodlez Active Member

    How do I put the "Sign Up Now!" Button into a notice (as well as keep it in the visitor side bar

    Thanks!

    I simply copied and pasted the code from the sidebar template but it was all messed up in the notice it showed everything in the link tag as the text on the button
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Notices don't have access to the same template functions and container params. Use this code in your notice:

    Code:
    <label for="LoginControl" id="SignupButton"><a href="index.php?login" class="inner">Sign Up Now!</a></label>
    
    The link and language is hard-coded.
     
    erich37 likes this.
  3. toodlez

    toodlez Active Member

    Very nice thank you Jake... had to tweak it a bit to suit my new things I implemented with my sign up / login system... But it is working!
     
  4. erich37

    erich37 Well-Known Member

    I have just tried this, but I am having an issue with the width of the "Sign Up Now"-button.
    The button has the width of nearly the notice.

    What is the best way of decreasing the width of the button in the notice ?


    Many thanks!
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Use inline styling and set a specific width.
     
    erich37 likes this.
  6. erich37

    erich37 Well-Known Member

    one more question please:

    is there actually a difference where I put the "slash" for the link (before the word "login" or after the word "login" or both) ?

    Code:
    <label for="LoginControl" id="SignupButton" style="display: block; width: 170px;"><a href="login/" class="inner">Sign Up Now!</a></label>
    Code:
    <label for="LoginControl" id="SignupButton" style="display: block; width: 170px;"><a href="/login" class="inner">Sign Up Now!</a></label>
    Code:
    <label for="LoginControl" id="SignupButton" style="display: block; width: 170px;"><a href="/login/" class="inner">Sign Up Now!</a></label>


    I am asking because at some other code (for linkling to the Register-page) I do have the "slash" at the beginning (in front of the word "register"), for example like this:

    Code:
    <a href="/register">Sign up to become a Member</a>

    So I am wondering where I should put the "slash" for the Link ?


    Thanks!
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Notices are displayed within XenForo, so relative links are appropriate (no beginning slash).
     
    erich37 likes this.

Share This Page