How to get current URL and page title in Magento

Here’s a snippet you can use in your Magento template to get the current URL of any page:

helper('core/url')->getCurrentUrl(); ?>

… and here’s how to get the current page title:

getLayout()->getBlock('head')->getTitle(); ?>

Leave a Reply

You must be logged in to post a comment.