url helper help

Permalink
Hi,

i'm struggling to work out how the URL helper helps to construct urls for inside blocks.

I have setup a single page (match-fixtures) and in a block I would like to link to this page.
How can i use the url helper to format the correct url for weather the site has pretty links enabled or disabled?

Thanks

View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Two ways I know of:

1) If you have the path to the page (not the full URL, just the path relative to the home page), you can do this:
<?php echo View::url('/page/path'); ?>


2) If you have the collection object ($c in the example below), you can do this:
<?php Loader::helper('navigation')->getLinkToCollection($c); ?>


The "URL Helpers" are somewhat of a misnomer -- they are for constructing and parsing url strings, not for getting url's to concrete5 pages.

-Jordan
CrystalShardz replied on at Permalink Reply
thanks for the advice.

i notice i've been asking alot of questions and not answering many...hopefully i'll be able to reverse that and give back to the community soon once i learn more about the system lol
jordanlev replied on at Permalink Reply
jordanlev
Don't feel bad about asking questions -- we all had to learn this stuff at some point.