Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 02:26:08 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
155555
Posts in
21715
Topics by
7737
Members
Latest Member:
gx-world
WebsiteBaker Community Forum
English
Archive (posts up to 2007)
(Moderator:
Argos
)
Problem with Nautica template
Pages: [
1
]
Go Down
Author
Topic: Problem with Nautica template (Read 1667 times)
adamr
Offline
Posts: 6
Problem with Nautica template
«
on:
April 18, 2007, 03:09:09 PM »
Hi,
My site build with WB is going very well, and I'm modifying a version of Nautica Liquid, but I have an odd problem.
Sub-menus appear on the right-hand side of the page, but the space allocated for the menu stays there even if there is no sub-menu. This means pages of text/pictures have a big border down the right-hand side with nothing in it.
For example, look here >
http://www.cornwalltangsoodo.co.uk/
. You can see the invisible margin on the right, so the text doesn't fill the page properly.
Can anyone offer a simple solution, or a solution of any kind? Is it just a css tweak?
Thanks in advance.
Logged
ruebenwurzel
WebsiteBaker Org e.V.
Offline
Posts: 7973
Re: Problem with Nautica template
«
Reply #1 on:
April 18, 2007, 03:17:52 PM »
Hello,
two possible solutions:
1. Make a second template (copy from your main template) without the submenu and use this for pages without submenu.
2. Use a simply query in the index.php wich makes the whole section only available when a submenu is present (output buffer, foo).
Matthias
Logged
adamr
Offline
Posts: 6
Re: Problem with Nautica template
«
Reply #2 on:
April 18, 2007, 03:20:48 PM »
Would you have an example of this code for the index.php? I realise it's probably just something like an 'ifexist' check, but I'm not sure of the syntax.
Logged
kweitzel
Forum administrator
Offline
Posts: 6977
Re: Problem with Nautica template
«
Reply #3 on:
April 18, 2007, 06:37:57 PM »
The outputbuffer is your friend in this one. Have search through the forum with the keyword "output buffer" ... you'll get some good results.
cheers
Klaus
Logged
WebsiteBaker Org e.V. - for WebsiteBaker
adamr
Offline
Posts: 6
Re: Problem with Nautica template
«
Reply #4 on:
April 18, 2007, 07:42:16 PM »
Ok, I think I'm starting to find the kind of thing I want, but I'm still a bit stumped.
Here's the code which generates the page...
Code:
<div id="content">
<h2>
<?php page_title
(
''
,
'[PAGE_TITLE]'
);
?>
</h2>
<p>
<?php page_content
();
?>
</p>
</div>
</div>
<div id="wrapper-footer">
<div id="footer"> ©
<?php page_title
(
''
,
'[WEBSITE_TITLE]'
);
?>
</div>
and here's the snippet of code I found on the forums which seems to relate to something like I'm trying to do...
Code:
<?php ob_start
();
// start output buffer
page_content
(
2
);
// call block
$foo
=
ob_get_contents
();
// put outputbuffer in $foo
ob_end_clean
();
// clear outputbuffer
if (
$foo
<>
""
) {
// some code to execute cause there is some block
echo
$foo
;
// show the block (as saved in $foo)
} else {
// some code for non blocks
echo
"no block today"
;
}
?>
but I have no idea how to check for the sub-menu block which is being drawn on the page, or how I'd force the content to take 100% of the width if none was present
Logged
kweitzel
Forum administrator
Offline
Posts: 6977
Re: Problem with Nautica template
«
Reply #5 on:
April 18, 2007, 09:47:55 PM »
In the index page you find this code:
Code:
<div id="wrapper-menu-page">
<?php ob_start
();
// start output buffer
show_menu
(
1
,
1
,-
1
,
true
,
'<li>[a][menu_title][/a]</li>'
,
''
,
''
,
''
,
''
,
''
);
// call menu
$foo
=
ob_get_contents
();
// put outputbuffer in $foo
ob_end_clean
();
// clear outputbuffer
if (
$foo
<>
""
) {
// some code to execute cause there is some block
echo
'<div id="menu-page">'
;
echo
'<h3>Menu</h3>'
;
echo
'<ul>'
;
echo
$foo
;
echo
'</ul>'
;
// show the block (as saved in $foo)
echo
'</div>'
;
} else {
// some code for no info
}
?>
</div>
You need to change it so the DIV is not beeing created, if there is no menu output. The code posted below should do exactly that, but it is not tested!
Code:
<?php ob_start
();
// start output buffer
show_menu
(
1
,
1
,-
1
,
true
,
'<li>[a][menu_title][/a]</li>'
,
''
,
''
,
''
,
''
,
''
);
// call menu
$foo
=
ob_get_contents
();
// put outputbuffer in $foo
ob_end_clean
();
// clear outputbuffer
if (
$foo
<>
""
) {
// some code to execute cause there is some block
echo
'<div id="wrapper-menu-page">'
;
echo
'<div id="menu-page">'
;
echo
'<h3>Menu</h3>'
;
echo
'<ul>'
;
echo
$foo
;
echo
'</ul>'
;
// show the block (as saved in $foo)
echo
'</div>'
;
echo
'</div>'
;
} else {
// some code for no info
}
?>
cheers
Klaus
Logged
WebsiteBaker Org e.V. - for WebsiteBaker
adamr
Offline
Posts: 6
Re: Problem with Nautica template
«
Reply #6 on:
April 18, 2007, 11:32:13 PM »
Thanks, that's great. It's eliminated my problem but presented another small one (the pages now reach beyond the borders previously applied) but I'm sure after a good nights sleep I'll be able to figure something out.
Thanks for the help, I'll be sure to pop back if it's driving me insane
Logged
adamr
Offline
Posts: 6
Re: Problem with Nautica template
«
Reply #7 on:
April 19, 2007, 08:57:07 AM »
I really can't get this final piece of the jigsaw to fit now.
The fix above works brilliantly, thank you, the menu column is now not present if there is no content.
However, the left margin is now not present, so the text starts from the left-hand side of the page, not lined up with the banner/logo as it used to be.
So for some reason, if the wrapper-menu-page call is placed inside the output buffer section (as per the fix above), the left-most margin doesn't appear and the text isn't lined up.
As it stands at the minute, you can see the problem here >
http://www.cornwalltangsoodo.co.uk/pages/introduction.php
I just don't understand why calling that div inside the
if
loop breaks it like that, any idea?
Logged
adamr
Offline
Posts: 6
FIXED!
«
Reply #8 on:
April 19, 2007, 04:21:41 PM »
I just managed to fix the template, and thought I'd share in case anyone else came up against the same problem!
The problem was twofold. Firstly there was an extra </div> towards the bottom of index.php which didn't need to be there, which was closing the wrapper-content div before anything was being displayed, that's what caused the left-most margin to disappear.
Secondly, there was a definition in the style.css which didn't need to be there, in #content.
Code:
#content {
background: transparent url('images/bg02-white-right.png') no-repeat right top;
padding: 5px 245px 5px 40px;
}
I imagine the 245px was put in originally to line up the text with the sub-menu, but it doesn't need to be there. changing it to...
Code:
#content {
background: transparent url('images/bg02-white-right.png') no-repeat right top;
padding: 5px 40px 5px 40px;
}
...fixed it immediately and my site now works perfectly.
Thanks for all the help!
Logged
kweitzel
Forum administrator
Offline
Posts: 6977
Re: Problem with Nautica template
«
Reply #9 on:
April 19, 2007, 08:56:00 PM »
And it does look good as well ... maybe we should implement this fix into the original template as well ...
cheers
Klaus
Logged
WebsiteBaker Org e.V. - for WebsiteBaker
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...