Create your own placeholders

Previous answer
Main page of Friday 101
Next answer

You can create your own placeholders to use as a kind of "shorthand" in your questions and answers.

For example, suppose you want to include a graphic image of a "NEW!" logo next to each new question you add to your FAQ. You could add the HTML code necessary to display the image to each of your questions, but that'd be tedious, ugly and difficult to maintain.

Instead, create a new placeholder. Add the following to your FRIDAY.FQA file:

[UserPlaceholders]
Count=1
Placeholder1=:logo:
Replacement1=<img src="logo.gif" border="no" height="16">

Now all you need to do is type :logo: in your questions or answers wherever you want Friday to substitute the HTML code needed to display your logo 16 pixels high. Border="no" prevents the browser from putting a border on the image when it's part of a link, as it will be if you include it in your questions.

You can add more placeholders if you like. Suppose you want to include a little ad copy to each page on your site. For example "Today's special is XXX. Click here for more info."

Start by updating the Count= line. Count must equal the number of UserPlaceholders you've defined.

[UserPlaceholders]
Count=2

Then, underneath the existing placeholders, add the new entries for your Placeholder number 2:

Placeholder1=:logo:
Replacement1=<img src="logo.gif" border="no" height="16">
Placeholder2=:ad-copy:
Replacement2=Today's special is FRIBBETS! <a href="fribbets.htm">Click here</a> for more information.

Now all you need to do is add the placeholder you've just defined, :ad-copy:, to the templates where you want your ads to appear. Friday will fill in the correct copy when you Create HTML. Tomorrow, update the Replacement2 info to today's special, Create HTML again and you've updated your entire FAQ.

Reminder: Whenever you add or remove a placeholder, be sure to change the Count= line to reflect the current number of placeholders.

NOTE: If you use user-defined placeholders to insert HTML code into your questions (as in the image example above) the inserted HTML may foul things up when you also use the :question: placeholder to add the question to e.g. the page's Title tag or as the target of a named location.

In situations like this, use the :question.s: placeholder instead of the normal question placeholder.
See question.s for more details.


Filename: FAQ00136.htm
Last edited on 11/12/2002 6:11:45 PM

Naturally, all content & site maintenance by

Friday The Automatic FAQ Maker