WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Placing menus & attaching content blocks to a page

(1/3) > >>

Anlina:
Okay, there's two things I'm trying to do and I'm not sure the best way to go about it.

1. Placing a menu inline with page content.

On my page, I have my main navigation to the left. I have an optional subnavigation that should appear as a box that sits within the main content of the page (similar to an image that text wraps around.) It should appear directly below the top header & subheader and be floated right.

What is the best way to implement this? The box should only appear when there are child pages and needs to sit inside the content area, with content wrapping around it.

I understand how to use multiple menu calls, I'm just not sure how to get the menu inside my content area (I want to keep all the pages WYSIWYG, as I will not be the only person editing the content.)

2. Placing a block of content beside my main content area.

To the right of my main content area, I want to be able to place an image with a caption below it. I'd like to be able to assign certain images & captions to specific pages.

Is there a way to do this, short of just manually inserting the image and caption into the content area and then using CSS to position it correctly? I'd like to minimize the amount of html in the page, because again, there will be other people editing the text on the page, and the less there is that they can screw up the better.

----

Screenshot of the mocked up layout is attached for reference.




[gelöscht durch Administrator]

Ruud:
Hiding/showing the menu (including the surrounding div) can be done like this.


--- Code: ---<?php 
// Submenu region, only shown when submenu&#39;s are available
ob_start();
show_menu2(1, SM2_ROOT+1, SM2_START, false,&#39;[li][a][menu_title]</a>&#39;,&#39;</li>&#39;, &#39;<ul>&#39;);
$childmenu=ob_get_contents();
ob_end_clean();
if ($childmenu!="") {?>
<div id="submenu">
       <?php echo $childmenu; ?>
</div>
<?php } ?>
--- End code ---

If there is no submenu, the div is also not sent.

For the second block of content you could simply use an extra content block.
Create your images and captions in hidden wysiwyg pages that your editors cannot see or change.
Use the section-picker to add them to the pages.
Make sure the editors don't have the rights to edit the section-picker module.

Styling everything with CSS is possible, but it won't be simple ;-)

Hope this helps you further..

Ruud

Anlina:
Thank you that was very helpful. I've got the image & caption showing - now to style it with css. :)


Your code snippet works great for displaying the child menu for my first menu [1]. I tried using it to display the child menu for a second menu [2] and changed it like so:


--- Code: ---();
show_menu2(2, SM2_ROOT+1, SM2_START, false,'[li][a][menu_title]</a>','</li>', '<ul>');
--- End code ---

But it doesn't seem to work. Am I missing something?

Edit: Okay, got things functional using SM2_ALLMENU, but I'm still curious why I can't get it working when I specify just my second menu.

Ruud:
I think (not tested) show_menu2(2,.....) will only show when the current page is in the same tree. So a page that must be a "member" of the 2nd menu.

According to the manual the SM2_ALLMENU is made for your situation. Show all menus.

Good luck with the styling.

Ruud

Anlina:
Thanks Ruud.

Okay, I really, really, really, really want the markup for the submenu to appear below my h2 heading (so, right in the middle of the content really.)

Is there any way to do this? It would make my life infinitely simpler, since I cannot think of a single way to get the content to wrap properly around the submenu when the markup appears above everything, where as a simple float will solve my layout problems if I can stick the markup where I want it to be.

I tried putting the code snippet Ruud provided into a Code section on my page, but that doesn't work.

Any ideas? Is this possible at all with WebsiteBaker?

Navigation

[0] Message Index

[#] Next page

Go to full version