How to get the URL of a CMS page or a static block in Magento

Here’s how to get the URL of a CMS page or a static block in Magento.

Using the block or page Id:

Using the key:

In another cms block or page:

In a template file: