Announcement

Collapse
No announcement yet.

Login Button that opens as Popup

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Login Button that opens as Popup

    Hi there,

    I have created a login button that opens in a nice popup...

    So maybe someone is also interested in it... so I share it with you

    I have changed some code from the original source here: https://codepen.io/hahamimidido/pen/YqKpzv (There is also a demo to see how it works)

    Then I just made some customizations in order to get it work without no problems with our forum style template. So it might be necessary, that you also need to change some of the dimensions/positions. Depends on where you place the button and how it looks like on mobile devices... so you shoul also add CSS Media Queries.

    In order to show the button only to users who are not logged in yet, just put the following html code into an "ad module" and place it to the section of page where you want to show the button.
    Then turn "who can view" on for "unregistred/not logged in users". (Don´t know whats the correct phrase for this in english)

    And of course you have to change "example.com" to the correct link to your domain

    Code:
    You need to be logged in to view the code. Login or Register now!
    Then I added the following Code to the additional_CSS

    Code:
    You need to be logged in to view the code. Login or Register now!
    Then I added the following Code to the footer template right before closing body tag:

    Code:
    You need to be logged in to view the code. Login or Register now!
    Thats all

    Except: If you don't use fontawesome yet on your forum, then you also need to add it.

    Just place
    Code:
    You need to be logged in to view the code. Login or Register now!
    right on top of your additional CSS Style

    or if this does not work you need to place
    Code:
    You need to be logged in to view the code. Login or Register now!
    right on top of your head_include template in admincp


  • #2
    Thanks for sharing shining.

    You don't have to edit the footer template to add the Javascript code at the bottom of the page. You can create a new template and paste the Javascript there and then use it in a template hook in footer_before_body_end hook location. This is one of the ways to create a vB5 mod.

    Comment


    • shining
      shining commented
      Editing a comment
      Oh didn´t know that ...

    • shining
      shining commented
      Editing a comment
      What do I have to add to the template in order to show/load it only for logged out users (or other user groups in other cases )

  • #3
    i will saw it thank you

    Comment


    • #4
      You need to be logged in to view the quote. Login or Register now!
      You could look into header template and use the condition of login:

      Code:
      You need to be logged in to view the code. Login or Register now!

      Comment

      Working...
      X