Script in tools but with menu etc
Permalink
I've got a PHP script currently sitting in the /tools folder since I need an onload and onunload but I would like to:
a) include the normal C5 menu bar
b) know the logged-in user ID
Is there a way of either including the normal C5 stuff, or putting my script somewhere else where my JavaScript is going to work?
a) include the normal C5 menu bar
b) know the logged-in user ID
Is there a way of either including the normal C5 stuff, or putting my script somewhere else where my JavaScript is going to work?
As a "single page" I can get the Google map to appear and my data is added to it, but for some reason I don't see the normal site menu bar (although I do get the admin bar at the top). Do I have to add something specific to the top of my script to make the menu bar display?
the layout of single pages are determined by the view.php in your theme.
Most themes just wrap the page in a super simple way (kinda the point), but if you want top navigation & such, just open up one of your theme pages (default.php possibly) then replace the main content area
You can then put the page in edit mode and add the same autonav block or whatever that you have on your other pages.
Most themes just wrap the page in a super simple way (kinda the point), but if you want top navigation & such, just open up one of your theme pages (default.php possibly) then replace the main content area
<?php $a = new Area('Main'); $a->display($c); ?> [code] with the contents of your single page: [code] <?php echo $innerContent ?>
You can then put the page in edit mode and add the same autonav block or whatever that you have on your other pages.
OK, have copied suggested stuff into my script, so I now have:
I can then use the in-built page editor to add the top-level menu, but it appears as a vertical bulleted list.
If I also add this at the top:
I get the header twice.
I can then use the in-built page editor to add the top-level menu, but it appears as a vertical bulleted list.
If I also add this at the top:
$this->inc('elements/header.php');
I get the header twice.
Edit the header nav, select custom template -> header nav or something like that. That should get rid of the list.
That's done it! Thanks.
Now I've got to persuade my script with two embedded maps to work!
Now I've got to persuade my script with two embedded maps to work!
As a hint to anyone wanting to use embedded Google Maps, it appears their scripts are very fussy about the order in which pages are created. As a guide, put the JavaScript block that actually puts the map on screen as late in your script as possible - define all the functions it calls first, then use the "map = new GMap2" last, even if this means having it a completely separate JavaScript block.
$(document).ready()
...in JavaScript, but the C5 menu bar disappeared. So I'm back to having to have my script in /tools