Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Inserting a Text Macro into Your Source Code

GoLive ships with some pre-defined text macros for you to use when working with your HTML source code. Though you can also use macros in Layout mode, which I'll cover later in the project, GoLive's default macros allow you to insert HTML code in source mode. For example, there's a macro to insert an opening and closing anchor tag, as well as one to insert an image tag with blank attributes. Other macros can be created for use within the JavaScript or Web Objects editors, or within any GoLive window. To apply a macro you simply need to type the macro's name and then press the macro command keys. To see how this works you'll now apply a pre-defined GoLive macro to insert an <a href=""> macro named "a".

  1. Open a new or existing GoLive document and switch to the HTML Source editor.

  2. Type a anywhere in the document window.

  3. Press the macro command keys: Ctrl+Shift+M (Windows) or Command+Shift+M (Mac OS).

  4. GoLive automatically inserts generic code for an <a> anchor tag after the cursor because a predefined macro named "a" contains this code.

    Figure 1.1 The "a" macro inserts an <a> tag and a blank HREF attribute.


    Macro names are not case-sensitive; GoLive doesn't care whether you type the name in upper- or lowercase.

  5. Advance your cursor to the next empty line down in the source code and type img.

  6. Press the macro command keys again.

  7. GoLive automatically inserts an <img> tag after the cursor with blank source and border attributes.

  8. Figure 1.2 The "img" macro inserts an <IMG> tag and blank image attributes.

  • + Share This
  • 🔖 Save To Your Account