Does anyone know how to make 1 login/logout link that changes depending on whether the customer is logged in or logged out?
I want to move the horizontal navigation menu to a Simple HTML module on the left hand sidebar, but not sure how to move the login/logout button. I'm attaching a picture to give an idea of what i'm trying to do...
I want to move the horizontal navigation menu to a Simple HTML module on the left hand sidebar, but not sure how to move the login/logout button. I'm attaching a picture to give an idea of what i'm trying to do...
Attachments
Screen shot 2010-10-16 at 5.33.54 PM.png (32.15 KiB) Viewed 6065 times
Last edited by i2Paq on Sat Oct 16, 2010 7:14 pm, edited 1 time in total.
Reason: Topic moved
Reason: Topic moved
on default2 i use something like this:
but not tested yet on module
Code: Select all
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?></a>
<?php } ?>
Hey, thanks for that qahar. One question though, were would I try out your code above? What folder and file?qahar wrote:on default2 i use something like this:
but not tested yet on moduleCode: Select all
<?php if (!$logged) { ?> <a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?></a> <?php } else { ?> <a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?></a> <?php } ?>
Hmm, thanks for the help guys, but unfortunately I can't paste php code in the html module (at least not anyway I know how).
Actually I want to move the whole horizontal navigation menu over to the left hand column. Have to play around with it a bit and see if I can figure it out.
Actually I want to move the whole horizontal navigation menu over to the left hand column. Have to play around with it a bit and see if I can figure it out.
Thanks jones,jones wrote:so let me see the codes of your Main Menu .tpl, just put it here and let me know where do you place your Main Menu .tpl file?
header.tpl located at
catalog\view\theme\YOUR_THEME\template\common\
My Main Menu is just a Simple HTML module. I got it from http://www.kreasimote.com/component/con ... ncart.html.
I put it at theme\YOUR_THEME\template\module\.
The code for the .tpl file is below:
Code: Select all
<div class="box">
<div class="top">
<?php
if($title) { ?>
<img src="catalog/view/theme/default/image/brands.png" alt="" /><?php echo $title; ?>
<?php
} ?>
</div>
<div class="middle" style="text-align: left;">
<?php echo $code; ?>
</div>
<div class="bottom"> </div>
</div>
I think you already know the answered...
come on friend, don't waste your time
then figured from admin module, right? so mean you able to input html code then output as html decode, but it can't accepted special chars of php without encode to ascii / numeric chars, it's hard to explain
at the end your module can't handle php code, so impossible you will run the php conditions
i see you were answer at http://forum.opencart.com/viewtopic.php?f=113&t=6864 (itu masih berhubungan lagi)
am i missing?
come on friend, don't waste your time
then
Code: Select all
<?php echo $code; ?>
at the end your module can't handle php code, so impossible you will run the php conditions
i see you were answer at http://forum.opencart.com/viewtopic.php?f=113&t=6864 (itu masih berhubungan lagi)
am i missing?
If you copy the html from your mymodule in admin, then paste it into the mymodules .tpl file. Then replacing the login/logout links with the php code should work.
Code: Select all
<div class="box">
<div class="top">
<?php
if($title) { ?>
<img src="catalog/view/theme/default/image/brands.png" alt="" /><?php echo $title; ?>
<?php
} ?>
</div>
<div class="middle" style="text-align: left;">
*****INSERT HTML & PHP HERE****
<?php echo $code; ?>
</div>
<div class="bottom"> </div>
</div>
Thanks for the script you gave earlier. My question is, how do you give this script a specific color?
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?></a>
<?php } ?>
here is what I have now
<td width="150" align="left"><b><font color="#a6ee53" size="2">
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?><span style="text-decoration: none"></span></b></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?><span style="text-decoration: none"></span></font></font></b></a>
<?php } ?>
</td>
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?></a>
<?php } ?>
here is what I have now
<td width="150" align="left"><b><font color="#a6ee53" size="2">
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?><span style="text-decoration: none"></span></b></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?><span style="text-decoration: none"></span></font></font></b></a>
<?php } ?>
</td>
Try that -
Code: Select all
<span style="text-align: left; color: #a6ee53; font-size: 14px; font-weight: bold;">
<?php if (!$logged) { ?>
<a class="tr_login" href="<?php echo str_replace('&', '&', $login); ?>" title="<?php echo $text_login; ?>"><?php echo $text_login; ?></a>
<?php } else { ?>
<a class="tr_logout" href="<?php echo str_replace('&', '&', $logout); ?>" title="<?php echo $text_logout; ?>"><?php echo $text_logout; ?></a>
<?php } ?>
</span>
i'm sorry for the "holy thread resurrection - batman!" - but i do need something very similar to what qahar first answered, but for 1.5.1.3 - default.
to me it seems as in the header.tpl neither $login nor $text_login seem to be available (as so for logout & logout_text)
could someone point me into the right direction?
thanks,
emo
to me it seems as in the header.tpl neither $login nor $text_login seem to be available (as so for logout & logout_text)
could someone point me into the right direction?
thanks,
emo
you could always just use a direct link,
<a href="<?php echo HTTP_SERVER . 'index.php?route=account/logout'; ?>">LOGOUT</a>
as i don't believe the login/logout location changes.
Mitchell Bray
http://www.echoedlight.com/
<a href="<?php echo HTTP_SERVER . 'index.php?route=account/logout'; ?>">LOGOUT</a>
as i don't believe the login/logout location changes.
Mitchell Bray
http://www.echoedlight.com/
Who is online
Users browsing this forum: No registered users and 75 guests