nudeyogi
06-16-2006, 06:08 PM
Hi there, I'm programming illiterate. In fact, when I first downloaded Pixelpost a couple of months ago, I didn't even know what a style sheet was, so I've really come a long way. You Pixelpost developers are really great and you've inspired me...
That said...
I wanted a way to edit my site navigation in one place, without having to make changes on each and every template when I want to change the menu, so I decided to try creating a Navbar addon. I used some code from sensuous' Bookmarks Toolbar (sorry -- I'm learning through reverse engineering).
And the Navbar addon works, for the most part. It works great on my image_template, browse_template, about_template.
But for the life of me, I can't figure out how to get the Navbar to appear on pages I've created with the page_template from the MiniCMS addon, or pages I created beforehand that are just general.html documents.
Any ideas?
I'm also using the mod_rewrite for clean urls, if that makes any difference.
Here is the php code I'm using for the addon:
$navbar_top = <<<EOT
<div id="navbartop">
•<a href="/page">page title</a> •
<a href="/nextpage">nextpage title</a> •</div>
EOT;
$tpl = ereg_replace("<NAVBAR_TOP>",$navbar_top,$tpl);
When I right-click on a page_template page to look at the page source in my browser, I see <NAVBAR_TOP> in the code, but the actual Navbar doesn't appear on the page.
Could someone be so kind to tell me what I'm doing wrong?
Thanks!
That said...
I wanted a way to edit my site navigation in one place, without having to make changes on each and every template when I want to change the menu, so I decided to try creating a Navbar addon. I used some code from sensuous' Bookmarks Toolbar (sorry -- I'm learning through reverse engineering).
And the Navbar addon works, for the most part. It works great on my image_template, browse_template, about_template.
But for the life of me, I can't figure out how to get the Navbar to appear on pages I've created with the page_template from the MiniCMS addon, or pages I created beforehand that are just general.html documents.
Any ideas?
I'm also using the mod_rewrite for clean urls, if that makes any difference.
Here is the php code I'm using for the addon:
$navbar_top = <<<EOT
<div id="navbartop">
•<a href="/page">page title</a> •
<a href="/nextpage">nextpage title</a> •</div>
EOT;
$tpl = ereg_replace("<NAVBAR_TOP>",$navbar_top,$tpl);
When I right-click on a page_template page to look at the page source in my browser, I see <NAVBAR_TOP> in the code, but the actual Navbar doesn't appear on the page.
Could someone be so kind to tell me what I'm doing wrong?
Thanks!