Zen Follower
- Join Date:
- Jan 2010
- Posts:
- 130
- Plugin Contributions:
- 0
Very critical page layout issues
YEs I want login box only on home page. But banner on every page.
Views: 3,742
Zen Follower
YEs I want login box only on home page. But banner on every page.
Black Belt
OK, now if you want the login box at the top of the header, that will require some fancy positioning if the code is in define_main_page.php. Define_main_page is only intended to operate within the center column of the main content area, not in the header.
I suggest that things to go in the header should be in tpl_header.php. You can wrap an if() test around the login box code so it only displays on the home page.
Zen Follower
OK
Now I came to know something about Zen Cart layout with help of you all I made some changes in my tpl_header.php and I also uploaded the site on my server. https://www.oemxtrade.com
Please see the tpl_header.php code below but User Id and Password and image button is not coming.
<?php
/**
* Common Template - tpl_header.php
*
* this file can be copied to /templates/your_template_dir/pagename<br />
* example: to override the privacy page<br />
* make a directory /templates/my_template/privacy<br />
* copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
* to override the global settings and turn off the footer un-comment the following line:<br />
* <br />
* $flag_disable_header = true;<br />
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
?>
<?php
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-navigation display-->
<!-- My edit code -->
<div id="logoWrapper">
<div id="loginBox">
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
</div>
<div id="logo">
<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<?php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<!--eof My edit code -->
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<?php } } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
<!--eof-navigation display-->
<!--bof-branding display-->
<br class="clearBoth" />
<!--eof-branding display-->
<!--eof-header logo and navigation display-->
<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->
<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>
```
Black Belt
<div id="loginBox">
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
</div>
```This is only a link to the login page, not the login box code. You need the <div id="login">
section you showed in post 19. However, when I look at it, that is just two inputs, without a form to process them. Where did you get that code? There should be more around the inputs that you missed.
If, as I suspect, you wrote the whole thing yourself, none of it will work. You need to find some form code that works and copy that, perhaps from a login sidebox.
Zen Follower
Yes GJH42
I wrote the whole code. But I had a confusion do I need to put the <div id="login"> part in tpl_header.php and define the login style in stylesheet.css
did you saw my site its online :oops:
Black Belt
Yes, the <div id="login"> goes in tpl_header.php, and you would style #login {} and its interior parts in your stylesheet.
Zen Follower
YES I made the changes and got result but little difficulty came but I think I cam solve it with your guidance. Please take a look on https://www.oemxtrade.com
My Logo came down
Black Belt
As I said, the plain input fields you have will not work. You need to find complete login form code and use that. Try the Login Sidebox in Free Addons.
Zen Follower
Hi GJH42
May I know your name... out of track query..:D
By the way thanx a lot for your help and guidance. Please take a look on https://www.oemxtrade.com at last what I want I got.
Now I am trying to figure out how to process user id and password for login process which php file I have to call on GO button click event.
Atpresent my login division looks like this -
<div id="logoWrapper">
<div id="logo">
<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<?php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
<div id="loginBox">
<a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
</div>
<div id="login">
<div style="float: right; color: rgb(54, 57, 61); padding-top: 0pt; padding-bottom: 0pt; padding-left: 0px; width: 210px; text-align: right; line-height: 2px;">
Email Address: <input type="text" name="index_login_id" id="textfield" />
<br>
Password: <input type="password" name="index_login_password" id="textfield2" />
<br>
<img src="includes/templates/template_default/buttons/english/button_login.jpg" style="width: 22px; height: 22px;" />
</div>
</div>
</div>
Can you please give some suggestion on this. I am trying to put the input boxes inside form but how to process that form.
Regards
Vishal
Black Belt
I haven't used forms much, so am not going to try to tell you how best to set one up - you can get that info more reliably from a PHP/HTML tutorial site.
My suggestion, as before, is to look at a mod that already has the correct Zen Cart login code, like Login Box.
Zen Follower
OK GJH
I got your point I already download the Login Box code and trying to figure out it.
Zen Follower
Can you help me in linking my pages with the navigation menu on home page
I will be thankful to you
Black Belt
Do you mean this set of links?```
<div id="menu"> <ul> <li class="current_page_item"><a href="index.html">Home</a></li>
<li><a href="#">About Us </a></li>
<li><a href="#">Partners</a></li>
<li><a href="#">Community</a></li>
<li><a href="#">Contact Us </a></li>
</ul>
</div>
```I hope there is some PHP code behind this that is giving the class="current_page_item", as that will be different depending on which page you are looking at. If so, I would need to see your file code in that area to be sure of giving the right answer.
Mostly, you should be able to put the relative URL in place of the #. For Contact Us, it would look like
<li><a href="index.php?main_page=contact_us">Contact Us </a></li>
Zen Follower
Hi Glenn
You are Zen Master... Links are working.
But Glenn how can I modify registration form according to my requirements . I have more fields to add on the form and I got the table name where customers details are saved but where is the db connection and queries are written I am looking for that.
Do you have any idea of that.
thank you for your extended support.
Regards
Vishal
Zen Follower
Hi Glenn
Do you have any idea regarding database and registration form
Black Belt
That is a completely different question, and not in my area of expertise. You should search the forum, as it has been discussed many times, and post in a relevant thread with your questions if necessary.
Zen Follower
Any ways Glenn I am looking for the database issue in other thread but I have something for you.
After Login in I got the Log out and My Account Links I want to adjust them at correct place like these links should come on the right side of the menu, if possible.
I have one login account with
vishaldb28@ and gmail.com
123456
you can use this information for login and check the position of Log out and My Account link
With regards
Zen Follower
OK Glenn
I solved problem of log out, My Account. By putting little effort in tpl_header.php file.
Now I request you to please tell me how can I customize My Account page.
Regards
Vishal
Tell staff why this post should be reviewed.