HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[v4.2.0] Editing Header

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#55208 (In Topic #12018)
Avatar

Community saint

What I am trying to accomplish is that my header has the login option instead of inside a side block or in the "middle section" of the site page. See my example below of my want:



Thanks!

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55245
Avatar

Community saint

My logic of thinking was to grab the code in the main_greeting block, but I cannot seem to find that block in "manage themes". If anyone has ideas, please let me know.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55248
Avatar

Something like this I think…

Code

{+START,IF,{$IS_GUEST}}
<a href="{$PAGE_LINK*,:login:redirect={$SELF_URL}}">Login</a>
{+END}
{+START,IF,{$NOT,{$IS_GUEST}}}
Welcome back {$USERNAME*}
{+END}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#55254
Avatar

Community saint

That's even better. Thanks, Chris. Now I can easily change the welcome text to something more creative than the default login main greeting one.  :cool:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55261
Avatar

Community saint

Once logged in, I want the member's points to show underneath their greeting. This is what I attempted but it's not working. Any coders willing to help?

Code

{+START,IF,{$NOT,{$IS_GUEST}}}
<b>Hello {$USERNAME*}!</b> [ <a href="http://malesims.com/personalzone/index.php?page=myhome">Personal Zone</a> | <a href="http://malesims.com/index.php?page=login&type=logout">Logout</a> ]
<br>
{+START,IF,{$HAS_SPECIFIC_PERMISSION,use_points,{$MEMBER}}}
<strong>Points: {$REMAINING}</strong>
{+END}
{+END}

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55269
Avatar

Not REMAINING, AVAILABLE_POINTS.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#55291
Avatar

Community saint

I was doing some SU testing as a "Guest" and noticed an error at the bottom of my site:

A parameter, LOGIN_URL, is referenced in the template, HEADER, but not passed

In my header, I added the login option:



Code

{+START,IF,{$IS_GUEST}}
<form action="{LOGIN_URL*}" method="post" class="autocomplete side_block_form">
<div>
<div class="constrain_field">
<b>Login:</b> <input alt="{!USERNAME}" accesskey="l" size="20" type="text" onfocus="if (this.value=='{!USERNAME;}'){ this.value=''; password.value=''; }" value="{!USERNAME}" id="login_username" name="login_username" />
<input alt="{!PASSWORD}" size="20" type="password" value="password" name="password" id="s_password" />
<input type="submit" value="{!_LOGIN}" /><br>
[ <a href="http://malesims.com/index.php?page=join">Join For Free</a> | <a href="http://malesims.com/index.php?page=lostpassword">Lost Password</a> ]
</div>
</div>
</form>
{+END}

I disabled the closed site so it was opened to see if the login actually works. It does. Can I get a bit of code cleanup help so the error goes away?

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55298
Avatar

There is no LOGIN_URL passed to that template. You could make one, {$PAGE_LINK*:login:login:redirect={$SELF_URL,1}}.
It will work without, but ideally logins should be routed through the login module.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#55300
Avatar

Community saint

Would I add this code in the header.tpl?

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#55302
Avatar

In substitution of {LOGIN_URL*}.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: