Anchors
Anchors allow you to click a link and jump to a specific part of the page instead of scrolling up and down manually. The page may have several topics and using an anchor allows you to move directly to the paragraph you want without using the scroll bar.
This is techniques often used on Frequently Asked Question Pages where you have a list of questions at the top, answers at the bottom.
Choose what you want to do. These are links to anchors on this page.
|
|
|
|
|
LINK TO ANCHOR USING CSB (from within the same file, not using script or code)
If you are placing links to anchors on the same page as your anchor or an anchor on a different page in the same design file, the easiest way to do it is to use the built-in linking that CSB provides. Works everytime, easily.
To place the anchor:
put cursor where you want the anchor
choose Insert Anchor and type the name (don't use spaces), OK
To link to the anchor:
select the link text or image you will use for the link
right click, choose Link to Anchor on
choose either Current Page or Another Page
choose the anchor name
OK
|
LINK TO ANCHOR USING ANY OTHER WAY
There are times you want to link to your anchor using a menu script, other code, from another site or another directory or many other reasons.
These links take a bit more effort.
CSB can publish your tlx design file with and without frames.
Anchors on those pages are VERY DIFFERENT when you try to link to them any way other than the built in CSB anchor link as described above!
Without Frames: all one page, top border will scroll up with the page
With Frames: the borders become separate parts of the page and will scroll separately like this page.
Important note: If your anchor is on a plain page with no borders, but you are publishing your tlx design file WITH frames turned on, you still must follow instructions for FRAMED pages.
LINK TO ANCHOR WITHOUT FRAMES:
If you publish your pages without frames a typical link to an anchor looks like this:
page name.htm#anchor name
A full url address would look like this:
http://www.samisite.com/test-csb2nf/id106.htm#blink
Whether you use the program to insert your links (like A below) or you use inserted HTML code to make a special menu, etc. the link will work fine if you use the pattern for your link shown in red.
Links in a FRAMED page (like this page) to a NON-FRAMED subdirectory can open up UNDER the top border of the framed page if the link contains a target ='_self'
|
These links will open in
this part of the window!
Open a new window showing the plain page published without frames that has the anchors.
|
http://www.samisite.com/test-csb2nf/noframeanchor.htm#Doe_J
|
LINK TO ANCHOR WITH FRAMES:
When anchors are used in combination with frames in either Trellix or CSB, there are two things that are different which cause work arounds to be necessary. (Need to understand frames better? Check out this page)
1)
|
Links to anchors have a different format!
As noted above, the typical link to an anchor without frames looks like this:
page name.htm#anchor name
But a link to an anchor on a page published with frames looks like this:
page name_anchor name.htm
A full url address would look like this: http://www.samisite.com/test-csb/id137_test3.htm
|
2)
|
The links depend on a SPECIAL page that CSB must create during publishing.
When anchors are placed in pages published with frames, CSB/Trellix actually creates a special page with the name of the anchor put into the page name, but it does not happen every time! This can cause scripts to not work!
If you place the link on the same page as the anchor:
it must be put in using "Link to an anchor on current page" as your link choice for the link to work. (see A below)
If you try to put a link in using HTML or javascript code (for a menu, etc) the link will not work.
In this case, the "special page" is not created so links not made by CSB/Trellix will not work.
But you can use the Frames Work Around to force CSB to create that page. Once the page is made, then the links to the anchors will work!
|
FRAMES WORK AROUND - EASY FIX!
Insert your anchor on one page.
Insert a link to the anchor from another page within the same tlx design file. Call this the "forcing link".
Make sure you use the "Link to an anchor on another page" to create the link. ( see sample E below) This causes the program to actually generate a the "special" htm page! Then any code you want to add would be able to link to that anchor using the page name_anchor name.htm format.
You can hide the "forcing link" in an inconspicuous part of a page, or
use a small graphic to link to the anchor, or
use a small graphic that blends in with the page at the very bottom of the page, or
make a separate links page that has no name or keywords, etc. that just has links to your anchors. This links page would be kept off any sequence line and should have no links going to it. It's sole purpose is to hold the anchor links. You can add it to your robot.txt file so it does not get googled.
LIVE EXAMPLE ON ANOTHER SITE!
On this page, http://www.lambertusa.com/coating/id40.htm in the COATING subdirectory, scroll down to the link that says "Is a second coat really necessary?" Click the link.
It will take you to an anchor (2ndcoat) on a different page (id19.htm) in a different subdirectory: http://www.lambertusa.com/resource/id19_2ndcoat.htm
CSB only made that special page because I have another link from within my RESOURCE tlx file to the link.
|
LINK TO ANCHOR ON FRAMED PAGE - TESTS!
A. This is a link to the first anchor: test1 This link works!
This link was placed into the page using " Link to an anchor on current page" and chose test1 from list
LINKS BELOW ARE MADE USING INSERTED HTML CODE:
B. This is a link to the second anchor:
test2
This link works!
This link was placed using inserted HTML code. #test2 This link will work because only the link name is used.
<a href="#test2" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#330066'">test2</a>
C. This is a link to the second anchor:
test2
This link will not work! Press BACK to return to this page if you try it!
This link was placed using inserted HTML code, using the same pattern as a link to a non-frame anchor.
This link will not work because the page is published with frames. The page will reload, but not go to the anchor!
<a href="http://www.samisite.com/test-csb/id137.htm#test2" target="_top" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#330066'">test2</a>
D. This is a link to the second anchor:
test2
This link will not work! Press BACK to return to this page if you try it!
This link was placed using inserted HTML code, using the same pattern as a link to a framed anchor.
This link will not work because the page is published with frames, but anchor is on the same page.
There is no link to anchor test2 from any other page in the tlx file so no special page was made by the program!
<a href="http://www.samisite.com/test-csb/id137_test2.htm" target="_top" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#330066'">test2</a>
E. This is a link to the third anchor:
test3
This link works using the work around!
This link was placed using inserted HTML code. This is the same code as shown above in D that did not work.
But this link will work because a link from another page was made which forced the creation of the special anchor page! Then any code that is inserted can use the special page name for the link.
<a href="http://www.samisite.com/test-csb/id137_test3.htm" target="_top" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#330066'">test3</a>
On the index page of this subdirectory design file, a link to test3 anchor was inserted.
This "forcing link" caused the special page id137_test3.htm to be made so the link would work properly on this sample.
I could have used a gray image so noone would be able to see it, but choose to make it a text link to demonstrate.
F. This is a link to the fourth anchor:
test4
This link was placed using inserted HTML code.
This link will not work because the link is trying to link directly to the MIDDLE frame page, then to the anchor. CSB does not allow you to link to the middle frame page that way!
<a href="http://www.samisite.com/test-csb/id137_m.htm#test4" target="_top" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#330066'">test4</a>
TEST1 ANCHOR
TEST2 ANCHOR
TEST3 ANCHOR
TEST4
|