Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blog in menu
I'd like to add a blog to my GetSimple site (, but don't want to complicate the code. I've created a blog using a different system at and I'd like to add this as a menu item on my main site, but for the life of me I can't think how to do that. I'd be grateful for any pointers.
Thanks for giving me time to think about it. I've just put the navigation I wanted into the template, which was a perfectly obvious thing to do.
A way to do what you asked for, by patching GS:

- First create a new page. In this example, its slug should be 'blog'. Check 'Add to menu'
- Edit admin/inc/basic.php
- In line 295, insert:

if ($slug == 'blog') $url = '';

Dynamically generated menus like the one included with GS or other like Zegnat's Multilevel would display this custom link.

Important note: This is for GetSimple 2.01 -- not valid for 2.0 or older versions (which didn't use the patched find_url() function)
That's great - very elegant.
I'll be doing that,
It works very nicely.
But how do i add two (or more) menu items this way. I supose it must be simple but i'm not realy a hero in php.

Thanks in advance
Silence Is The True Friend That Never Betrays
Not tested, but should work:
switch ($slug) {
    case 'blog1':
        $url = 'http://first_blog_address';
    case 'blog2':
        $url = 'http://second_blog_address';
    case 'blog3':
        $url = 'http://third_blog_address';

Add as many "case ... break;" blocks as you need.

Just like my previous example, insert the code almost at the end of /admin/inc/basic.php, just BEFORE this line:
return $url;

(Line 295 in GS 2.01; around 348 or so in beta 2.02...)

Edit: Of course, you have to create in GetSimple pages with slugs blog1, blog2 and blog3 -or whatever name you want-. No need to put content in those, it won't be displayed.
Sweet! Works like a dream.

Silence Is The True Friend That Never Betrays
I can think of another -similar- way of doing this without patching GS, but with a plugin.

However, it would have a drawback (though 'normal' users would not notice it): URLs of menu links would be GetSimple's original ones. Once you click on them you'd be redirected to the 'external' (blog or whatever) pages.
Well, actually this a good way for me because i personaly don't really need links to an external site. I want to have menu items for a flash gallery i want to use, where you can use 'sort of' permalinks thru actionscript, something like:
But i want to keep the portfolio page too, like having the cake and eat it Smile. I've tried some other ways but actionscript/flash seems to be pritty picky due to securitysettings. And this is working well for me, so im going to stick with it.

If you can think of another better way, post it. I think others will find a good use for it.
Silence Is The True Friend That Never Betrays
By 'external' I meant any URL that is not a GetSimple-generated page, be it in the same server/site or in another.
phillphorrari Wrote:If you can think of another better way, post it. I think others will find a good use for it.

This other way would be a very simple plugin that adds a field to GS page options called "Redirect to URL:". The plugin would use hook 'index-pretemplate': before rendering the page, if the RedirectTo field is not empty, it would do a 301 redirect to the (URL) value.

This way you would not need to patch the core. But however, as I said, links in the menu would still be GetSimple URLs.

Users browsing this thread: 1 Guest(s)