Hotaru Docs

 [həʊdɒks]

Internal Linking

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:

myhotarusite.com/index.php?page=34
myhotarusite.com/index.php?page=profile

Friendly URLs ON:

myhotarusite.com/name-of-the-post/
myhotarusite.com/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.

In your templates, create links like this:

<a href="<?php echo $h->url(array('page'=>'page_wanted')); ?>">Page Wanted</a>

The first array element should be the page name, and you can follow that with other key=>value pairs.

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.

<a href="<?php echo $h->url(array('page'=>'page_wanted')); ?>#c102">Comment 102</a>

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.

Note 2: If you want to link to an Admin page, you can do it like this:

<a href="<?php echo $h->url(array('page'=>'page_wanted'), 'admin'); ?>">Admin Page Wanted</a>

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.

Getting StartedDesign and LayoutPlugin DevelopmentAdvanced TopicsFunction ReferenceTroubleshooting