Macros (Advanced)
A powerful, but underused feature of RapidWeaver
Last updated
A powerful, but underused feature of RapidWeaver
Last updated
Macros in RapidWeaver were initially implemented to help with theme development, however, some of them can be useful when used in the pages you create inside RapidWeaver. Let's get started by taking a look at an example that uses the Site Title macro.
Macros are tags that can be used within RapidWeaver pages to pull in content or details about your website. Macros tags also start and end with the % character.
For example, if you place "%site_title% within a text area on a page, the syntax would be replaced with the site title you specified in the Site Settings area.
Input: Welcome to %site_title%, I hope you like it.
Would then be turned into:
Output: Welcome to My Website, I hope you like it.
Why use a macro tag? If you used %site_title% throughout your site, you'd only have to update it in one place (Site Settings) to change the name of your website. Instead of having to manually change the instance on every page within your site.
RapidWeaver Classic support the following Macros:
The resources macro is one of the most useful macros. If you need to embed an image or have use for an image’s address, instead of hardcoding the link you can use a resource macro.
Whenever a resource macro is found in your project, RapidWeaver will substitute it for a link to the resource. Here's an example of the syntax:
The above macro would become a path to a resource called image.jpg. If the resource is inside a folder, be sure to include the name of the folder in your macro, like this:
You can get a resources macro by right-clicking on an image or file in the Resources Browser and choosing "Copy Macro", a super handy, yet little known feature.
You can then paste the "macro" into any area when you want to link to that resource.