To make your life as a template developer even easier, there are some handy helper functions
If you want to echo a page url in your templates without using an absolute url you can use the url() function like this:
<?php echo url('projects/project-1') ?>
It will take care of always returning the right absolute url.
If you need it even shorter, go for:
<?php echo u('projects/project-1') ?>
Sometimes it's nice to get the current url without much hassle. That's what thisURL() is for:
<?php echo thisURL() ?>
Redirects the user to the homepage
<?php home() ?>
Redirects the user to the error page
<?php notFound() ?>
This is just a shortcut for your templates to easily embed stylesheet files:
<?php echo css('styles/styles.css') ?>
You can also use this with absolute urls
<?php echo css('http://example.com/some/styles.css') ?>
This is another shortcut for your templates to easily embed javascript files:
<?php echo js('javascript/jquery.js') ?>
You can also use this with absolute urls
<?php echo js('http://example.com/some/scripts.js') ?>
Emebed a Youtube url as video
<?php echo youtube('http://www.youtube.com/watch?v=iUCDhvbQFmU') ?>
Emebed a Vimeo url as video
<?php echo vimeo('http://vimeo.com/33091687') ?>
Emebed any flash video file
<?php echo flash('http://yourdomain.com/flash.flv') ?>
Add a link to a Twitter profile
<?php echo twitter('getkirby') ?>