Pastor Rick
Head Administrator
Registered: 07-2005
Location: Texas
Posts: 560
Karma: 11 (+12/-1)
|
Reply ● Quote
|
|
Board Owner placed "Login" and "Logout"
How do I show an "if/then" secure "login" and "log out?" This question asked how a Runboard Owner could create this in a way that would be conditional and not as a constantly visible set of links that could prove to be confusing to the users.
What follows is what any coder would call "horrible coding practice." Put another way; this is a coding "hack" that rides on the Custom Language Set to achieve a good thing for the Runboard Owner.
Step One - CLS (setting new conditional markers):
Go to Control Panel > Board management > Customize the language set
You are looking for items that meet your conditions.
For a "log-out" text string or graphic, the easiest place is the entry titled: "control_panel." In that items customization field change the text to read: Control panel<body class="logged_in">
For a "log-in" text string or graphic, the easiest place is the entry titled: "misc_regacc_global." In that items customization field change the text to read: Sign up<body class="login">
There are other CLS entries you could use, but the ones I chose are the least confusing to work with when you are in steps 2 and 3 (IMHO).
Scroll down and click "submit custom set" to save your work in Step One.
Step Two - HTML (placing things where you want them to appear):
Go to Control Panel > Board management > Edit colors and theme > HTML management
In your custom HTML header box, you add the HTML code for where you want the new items to appear (it can be either a text string or graphic image). Your HTML will also need to include a "class" for the CSS to work with once you get to step three. For example:
logout <a href="/logout" class="logout">Logout</a>
log-in <a href="https://bmy_boards_name.runboard.com/login/" title="Secure Login" class="s_login">Secure Login</a>
In my example above I set my classes as "logout" and "s_login." Notice I also set the href for my log-in to be a "secure login" for my message board.
When you have the HTML links where you want them, scroll down and click on "Submit HTML preferences" to save your work before going to step three.
Step Three - CSS (getting things to work):
Go to: Control Panel > Board management > Edit colors and theme > CSS management
In your CSS you want to copy and paste this piece of code:
/* LOGOUT & LOGIN*/
.logout { display: none; }
.logged_in .logout { display: inline; }
.s_login { display: none; }
.login .s_login { display: inline; }
The code can go anywhere, but for my purposes, I decided to place the entry in the spot directly above the coding for the "/* WHOS ONLINE TABLE */." This placement makes the code easy for me to find later if I need to revisit my CSS.
The first line of the CSS targets the "class" named in the HTML and tells the system not to display the "class" by default.
The second line of the CSS is the fun part for me. It specifies how to display the "class" when it is visible. I decided to have my new "classes" to "display: inline" with other links I have on my message board. You could also use to have them as a "display: block" to have them display in their own unique line; so to speak.
When the CSS is where you want it to be, scroll down and click "Submit CSS preferences" to save your work.
- Fini
|
1/31/2018, 1:52 pm
|
Link to this post
Send Email to Pastor Rick
Send PM to Pastor Rick
Blog
|