Hotaru offers two kinds of links, standard and url-friendly. Site administrators can choose between them by changing the Friendly URLs setting in Admin->Settings.
Examples
Friendly URLs OFF:
Friendly URLs ON:myhotarusite.com/index.php?page=34
myhotarusite.com/index.php?page=profile
As a theme designer, you won't know which setting the site owner has chosen, so Hotaru provides a special function for creating links to match the Friendly URLs setting.myhotarusite.com/name-of-the-post/
myhotarusite.com/profile/
In your templates, create links like this:
The first array element should be the page name, and you can follow that with other key=>value pairs.PHP Code:<a href="<?php echo $h->url(array('page'=>'page_wanted')); ?>">Page Wanted</a>
If you are need to add a fragment at the end for jumping to specifi points within a page, e.g. a comment with a #c102 anchor, you'll need to attach that separately, i.e.
Note 1: If you need to link to a page with over three key=>value pairs, it's best to hard-code the url in the standard way, i.e. not url-friendly.PHP Code:<a href="<?php echo $h->url(array('page'=>'page_wanted')); ?>#c102">Comment 102</a>
Note 2: If you want to link to an Admin page, you can do it like this:
Using url-friendly urls for admin pages is quite limited and since Admin pages aren't SEO critical, it is more reliable to simply hard-code such links.PHP Code:<a href="<?php echo $h->url(array('page'=>'page_wanted'), 'admin'); ?>">Admin Page Wanted</a>
Note 3: This topic is also covered in the Plugins documentation here.


Reply With Quote

Bookmarks