Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL href
#1
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
Reply
#2
use one of php $_SERVER variables, or just GS: get_site_url(); functions, along with your menu slug var
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
If those are top-level pages (no parent):
Code:
<?php echo find_url($menu_1['slug'], ''); ?>
Reply
#4
(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!
Reply
#5
Carlos you think we might want to add a theme function alias for that, like get_page_url ?
Or get_nav_url or sumtin.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#6
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.
Reply




Users browsing this thread: 1 Guest(s)