GetSimple Support Forum

Full Version: URL href
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm relatively new to GS but I'm learning. I stumbled upon my first problem with links. I have a menu consisting of 4 links and I need to link them to their respective pages.

I know you can use:
PHP Code:
<?php get_navigation(return_page_slug()); ?>

but I'm currently using a different method because I call each link individually via this code (the variable $menu_1 contains the first item of my menu, I have 3 more):
PHP Code:
<li><a href=""><?php echo $menu_1['slug'];    ?></a></li> 

Now, what do I have to place as the href?

Thx in advance
use one of php $_SERVER variables, or just GS: get_site_url(); functions, along with your menu slug var
If those are top-level pages (no parent):
Code:
<?php echo find_url($menu_1['slug'], ''); ?>
(2014-01-29, 16:48:30)Carlos Wrote: [ -> ]If those are top-level pages (no parent):
Code:
<?php echo find_url($menu_1['slug'], ''); ?>

Works like a charm! Thanks!
Carlos you think we might want to add a theme function alias for that, like get_page_url ?
Or get_nav_url or sumtin.
Would be nice. get_page_url exists, so...
Could be get_page_link, though right now it should be getPageLink, unless:
https://github.com/GetSimpleCMS/GetSimpl...t-32723060

Would not be exaclty an alias BTW, you have to get the parent (or path, when GS supports multilevel urls) to do it properly.