Post by GoldenTongs » Sun Dec 21, 2014 2:54 pm

i am trying to remove everything except the login box from the login page

i have a mod that redirects users to login page if they are not logged in
(which i can apply to all reas of site or specific areas if i choose)

i want to remove the header, nav bar, search bar and basket, basically everything except the login box from the login page

when i look at login.tpl, i cannot remove <?php echo $header; ?>

evrything else can be removed fine except the header stuff as it then screws with the page layout

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by Selective555 » Sun Dec 21, 2014 3:22 pm

If you are not able to completely modify the login page as you want it, then the last alternative is to create a new login page and then have the redirect for those not logged in, to go to that new login page rather than the one already in the shop.

Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by GoldenTongs » Sun Dec 21, 2014 3:29 pm

Selective555 wrote:If you are not able to completely modify the login page as you want it, then the last alternative is to create a new login page and then have the redirect for those not logged in, to go to that new login page rather than the one already in the shop.
i already have a redirect for non logged in users to go to login page
your response does not really help as it seems i would just be creating a lot more work creating a new login page
but thanks for your time and response

all i am missing is the styling of the page once i remove header content
i remove the echo header line and then the layout/style of login page is gone

i will also need to remove header content from register page

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by GoldenTongs » Sun Dec 21, 2014 4:02 pm

easier explanation

all i am trying to do is remove/hide header content from specific pages
(top bar, search bar, nav bar and basket)

and maintain the page style and layout once i remove the first echo header line

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by opencarthow.com » Sun Dec 21, 2014 5:36 pm

GoldenTongs wrote:easier explanation

all i am trying to do is remove/hide header content from specific pages
(top bar, search bar, nav bar and basket)

and maintain the page style and layout once i remove the first echo header line
You can try to add custom CSS at specific pages you want to hide header, footer, ...
For example

Code: Select all

<style>
header {
display: none;
}
</style>

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by fido-x » Sun Dec 21, 2014 9:03 pm

The header.tpl file provides the opening <html> and <body> tags. The footer.tpl file provides the closing </body> and </html> tags. These are necessary. These must be included on your login page.

Edit catalog/controller/common/header.php and add the following:

Code: Select all

$route = $this->request->get['route'];
somewhere suitable. Do the same in catalog/controller/common/footer.php.

In your catalog/view/theme/default/template/common/header.tpl, wrap the code you wish to exclude with:

Code: Select all

<?php if ($route != 'account/login') { ?>
--- EXCLUDED CODE ---
<?php } ?>
and do the same in catalog/view/theme/default/template/common/footer.tpl

The "EXCLUDED CODE" will not display on the login page, but should still display on every other page.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by GoldenTongs » Sun Dec 21, 2014 11:38 pm

fido-x wrote:The header.tpl file provides the opening <html> and <body> tags. The footer.tpl file provides the closing </body> and </html> tags. These are necessary. These must be included on your login page.

Edit catalog/controller/common/header.php and add the following:

Code: Select all

$route = $this->request->get['route'];
somewhere suitable. Do the same in catalog/controller/common/footer.php.

In your catalog/view/theme/default/template/common/header.tpl, wrap the code you wish to exclude with:

Code: Select all

<?php if ($route != 'account/login') { ?>
--- EXCLUDED CODE ---
<?php } ?>
and do the same in catalog/view/theme/default/template/common/footer.tpl

The "EXCLUDED CODE" will not display on the login page, but should still display on every other page.
Thanks for the input
but all i am getting is
Notice: Undefined variable: route in etc. in header.tpl on line (wherever i place it)

am i being dumb and missing something ?

when you say add the first bit somewhere suitable is there somewhere specific you had in mind ?

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by GoldenTongs » Mon Dec 22, 2014 12:53 am

opencarthow.com wrote:
GoldenTongs wrote:easier explanation

all i am trying to do is remove/hide header content from specific pages
(top bar, search bar, nav bar and basket)

and maintain the page style and layout once i remove the first echo header line
You can try to add custom CSS at specific pages you want to hide header, footer, ...
For example

Code: Select all

<style>
header {
display: none;
}
</style>

i also tried this but it does not remove the navbar or top bar
it just removes the logo and cart and search bar

i can remove the navbar the same way by using .navbar
but am stuck trying to remove the top header bar

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by GoldenTongs » Mon Dec 22, 2014 12:59 am

getting there
.nav removes top nav bar just left with currency

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm

Post by GoldenTongs » Mon Dec 22, 2014 1:10 am

ALL DONE !!!!!
thanks to those who used their time to reply

i simply have

Code: Select all

<style>
.nav {
display: none;
}
.navbar {
display: none;
}
header {
display: none;
}
footer {
display: none;
}
</style>
added under the first echo header line,
the right coloumn and breadcrumbs i will simply remove

now i have private site with just a simple login screen displayed ;D
(also have redirect for user who are not logged in to redirect to login page)
until a user signs in

http://Lilphones.com
Image


Active Member

Posts

Joined
Sun Jul 29, 2012 5:26 pm
Who is online

Users browsing this forum: Majestic-12 [Bot] and 9 guests