How do I add a link in my page template to a pre-existing document?
You may have the need to add additional information to your page template, such that all output pages contain, say, a link to a notice, copyright, or other page separate from your ePublisher source material.
You can add any additional information necessary (page counters, surveys, etc.) by performing an override of Page.asp (the default page template). If you delve into the XSL a little bit, you can even devise conditional statements that will add custom elements only on particular page styles that you designate.
For this solution, though, we'll look at the addition of a link at the bottom of the page to an "Info/Copyright" file that has already been saved as HTML.
- First, you need to ensure that the necessary files are transferred to the output destination upon generating your ePublisher project. In the project's main directory (where the *.wep resides), you'll find a Files folder. Anything you put in this folder will automatically be copied to the output folder when you generate. So, place your copyright page (along with any necessary CSS, images, etc.) in this Files folder.
- Next, you'll add the reference to that file in your project's page template.
- Perform an override on a file called Page.asp, located by default in your ePublisher Pro installation directory, here:
ePublisher Pro\Formats\[your format]\Pages\ Note: for more information on the override procedure, please see our online technote article here: http://webworks.com/technotes/articles/ePublisherPro/EX_ePub_Project_Format_Overrides.36.1.aspx
- . Find the location at which you'd like to add your link.
- For this example, we'll add it at the bottom of the page, just after the main content. So, locate this line:
<hr wwpage:condition="footer-exists" align="left" />
- Above that, add the code
<div style="text-align:center" target="_blank"><a href="filename.html">Click Here for Copyright Information</a></div>
- Note: Replace "filename.html" with the name of the file you wish to reference. You can also add additional style info or any other details you require.
- Save Page.asp and regenerate
You should get a simple link at the bottom of each HTML output page referencing your copyright page, which will be included with the output. You can modify this procedure to add other links and page elements in a similar fashion.