The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
Blog in menu - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Installation & Setup (http://get-simple.info/forums/forumdisplay.php?fid=5) +--- Thread: Blog in menu (/showthread.php?tid=637) |
Blog in menu - richardhall - 2010-04-22 I'd like to add a blog to my GetSimple site (1sthope.org.uk), but don't want to complicate the code. I've created a blog using a different system at blog.1sthope.org.uk 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. Blog in menu - richardhall - 2010-04-22 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. Blog in menu - Carlos - 2010-04-23 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: Code: if ($slug == 'blog') $url = 'http://blog.1sthope.org.uk'; 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) Blog in menu - richardhall - 2010-04-23 That's great - very elegant. I'll be doing that, Blog in menu - phillphorrari - 2010-06-04 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 Blog in menu - Carlos - 2010-06-05 Not tested, but should work: Code: switch ($slug) { 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: Code: 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. Blog in menu - phillphorrari - 2010-06-05 Sweet! Works like a dream. Thanks Blog in menu - Carlos - 2010-06-05 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. Blog in menu - phillphorrari - 2010-06-05 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: Code: portfolio#num=0&id=albumname If you can think of another better way, post it. I think others will find a good use for it. Blog in menu - Carlos - 2010-06-05 By 'external' I meant any URL that is not a GetSimple-generated page, be it in the same server/site or in another. Blog in menu - Carlos - 2010-06-05 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. |