====Named hooks==== For a general introduction to hooks, see their [[harlowe:hook markup|respective markup description]]. Named hooks are a less common type of hook that offer unique benefits. To produce one, instead of attaching a macro, attach a "nametag" to the front or back: [This hook is named 'opener'][This hook is named 's2'] (Hook nametags are supposed to resemble triangular gift box nametags.) A macro can refer to and alter the text content of a named hook by referring to the hook as if it were a variable. To do this, write the hook's name as if it were a variable, but use the ''%%?%%'' symbol in place of the ''%%$%%'' symbol: [Fie and fuggaboo!] The above [[harlowe:click|(click:)]] and [[harlowe:replace|(replace:)]] macros can remotely refer to and alter the hook using its name. This lets you, for instance, write a section of text full of tiny hooks, and then attach behaviour to them further in the passage: Your [ballroom gown] As you can see, the top sentence remains mostly readable despite the fact that several words have [[harlowe:click|(click:)]] behaviours assigned to them. === Built in names: === There are four special built-in hook names, ?Page, ?Passage, ?Sidebar and ?Link, which, in addition to selecting named hooks, also affect parts of the page that you can't normally style with macros. They can be styled using the [[harlowe:enchant|(enchant:)]] macro. * ''%%?Page%%'' selects the page element (to be precise, the ''%%%%'' element) and using it with the [[harlowe:background|(background:)]] macro lets you change the background of the entire page. * ''%%?Passage%%'' affects just the element that contains the current passage's text (to be precise, the ''%%%%'' element) and lets you, for instance, change the [[harlowe:text-colour|(text-colour:)]] or [[harlowe:font|(font:)]] of all the text, or apply complex [[harlowe:css|(css:)]] to it. * ''%%?Sidebar%%'' selects the passage's sidebar containing undo/redo icons (''%%%%''). You can style it with styling macros, or use [[harlowe:replace|(replace:)]] or [[harlowe:append|(append:)]] to insert your own text into it. * ''%%?Link%%'' selects all of the links (passage links, and those created by [[harlowe:link|(link:)]] and other macros) in the passage. (Note that, as mentioned above, if you use these names for your own hooks, such as by creating a named hook like ''%%|passage>[]%%'', then they will, of course, be included in the selections of these names.)