This tutorial about adding anchors to iWeb uses the same technology (application) as the Alternative HTML FAQ uses.
Warning: it might seem to be a hassle and/or complicated to some of you but trust me, it isn’t, it’s very easy! Really! Try it!
What is an Anchor?
An anchor is a link which points to a part of the same page the link is added to.
Let’s make an example:
Say you have a page which is full of text and divided in chapters. You want to have an index of the chapters at the top of the page and when someone clicks on a link in that chapter index you want him to be taken directly to the chapter he wanted to read. How can you afford that? That’s what anchors are good for... Try it by clicking on this link which will take you straight to Note 1
How can I add Anchors to iWeb?
That’s how you do it:
1. Write the content of the page you want to have Anchors in
2. Instead of the chapter titles you type in a code like PagenameChapternumber (be sure to choose a unique name which doesn’t appear anywhere else on your whole website)
- Where you have the index add a 1 to the code, thus PagenameChapternumber1
- Where the chapter starts, thus where you want people to be pointed to from the index, add a 2 to the code, thus PagenameChapternumber2
Example:
Pagename: Anchors
Chapternumber: 1
- In the index: Anchors11
- Where chapter 1 starts: Anchors12
For chapter 2 on the same page
- In the index: Anchors21
-
-Where chapter 2 starts: Anchors22
and so on...
Put these codes Text Indent 2 px (Open the Inspector, go to the Text tab and choose List change the text indent to 2 px)
3. Now go here and Download MassReplaceIt (it’s free)
-
4.Open MassReplaceIt
5. In Find filed you enter the code for the index thus PagenameChapternumber1
6. In another Find field you enter the code where you want people to get redirected to thus PagenameChapternumber2
7. In the Replace of point 5 paste the following html-code:
<a href="#label">Text to display</a>
8. In the Replace field of point 6 paste the following html-code:
<a name="label">Text to be displayed</a>
9. Once you did that go and change the parameters “label” and “Text to display” to match your case
Text to display: the name of the chapter. In our example: Note 1
label: in our example will be note1 but in case of chapters label could simply be the number of the chapter
10. You can set more than one Find&Replace at once if you want to add more than one Anchor
11. Save the Query naming it something like Anchors so you know what it is and for future changes you just edit this query and re-save it.
12. In Files add the folder you publish to from iWeb or the iDisk folder (iDisk/Web/Sites folder)
13. Click “Replace” and it will search your pages for the codes you added in the Find fields. click on “Replace All” and the HTML code will be added
14. Re-run MassReplaceIt every time you (re-)publish
Note 1 : Linking to a specific part of the page from another page
To link to a specific part of the page from another page use an external hyperlink and this:
urlofthepage#nameoftheanchor
Example: http://alyeska.altervista.org/en/iWeb_Anchors.html#note1
Note 2: Important note about MassReplaceIt settings:
- In Options select Search=Contents, Location=Entire file/Filename, Options=Search whole words
- In Preferences When adding a folder to a search list=Add a folder, Search: folder’s name and contents
To fix it in a page copy and paste the textbox in the main textbox of your page. Now if you add text the “Snippet” will move automatically with the page.
We would like you to give us feedback on this page by commenting here. Tell us if it was helpful. If it wasn’t tell us why. If you think something is missing tell us what.
If you have a question please make sure it is relevant to the content of the page. Look through our FAQs and look where it fits best. If you can't find any FAQ on the topic post on the main page of our FAQs. Please do not post your question to the main page if there's a relevant FAQ. However we recommend you to post questions to the AppleDiscussionForum for iWeb.
Thank you.





