Defining Text Macros
GoLive stores macro names and associated text or code snippets in special editable text files. Open up the markup source macro file in the Text Macros folder to see how this works. The Text Macros folder is located in the Modules sub-folder of the GoLive Program folder and contains all of the text macro definition files. (Program/Settings/Text Macros). Look for the file named MarkupSource.macro and open this in GoLive.
Figure 1.3 GoLive's macro definitions are stored in special editable text files.
There are Four Kinds of Macro Definition Files:
The Default.macro (in the All folder) defines any HTML or JavaScript strings you want to create. These macros can be inserted into any editor window in GoLive.
The MarkupSource.macro (in the Markup folder) defines any text or HTML elements you want to create. These macros can only be inserted into the HTML Source window.
The JavaScriptSource.macro (in the JavaScript folder) defines snippets of JavaScript code. These macros can only be inserted into the JavaScript editor window.
The CSSSource.macro (in the CSS folder) defines CSS styles that you create. These macros can only be inserted into the Source pane of the CSS editor window.
You can change the text associated with a macro by editing its definition. In this next part of the project, you'll see how you can add a http://www. prefix and .com suffix to the URL in the "a" macro.
-
If you haven't already done so, launch the markup source macro file in GoLive (Programs/Settings/ TextMacros/Markup/MarkupSource.macro).
-
Now you'll make a simple modification by changing the URL so that it includes a "www." before the domain name and a ".com" after it. To do this, edit the URL for the "a" macro by changing it from a href="http://%where%"to a href="http://www.%where%.com".
-
Save the macro file.
-
Open a new document and switch to the HTML Source editor. If you want to apply the macro to a document that was already open before you modified the macro, you'll need to close the document first then open it again to reflect the new macro definition.
-
Type a followed by the macro command keys. GoLive inserts the new modified macro text.
Figure 1.4 Built-in macros defined in the markup source macro file.
Figure 1.5 Changing the text associated with a macro command.
The "%" characters in this macro are selection modifiers and indicate what part of the text will be highlighted when you apply the macro. You'll learn more about this feature as you continue with the project.
Figure 1.6 New macro text is substituted when you alter the macro definition file.
NOTE
If your macro isn't automatically inserted after you type the macro command keys, you may need to quit and restart GoLive first for the new macro to take effect.