View Full Version : Template Impossibility ?
hennesse
07-20-2014, 12:39 AM
My site is hierarchical with many levels, and I want to include an up-arrow that will allow the use to navigate to the next-higher directory.
<a href=”../index.html”><img src=”up-arrow.gif”></a>All my pages (except home page) use the same template, so it would be nice if I could just include this in the template.
However, DW thinks I want to reference that particular instance of index.html, so it updates it to "../../../../index.html" Wrong!
Is there any hack I can use to make DW leave the reference alone?
Dave
try edit in a text editor lik notepad. i realy thik this is a flaw in dw template system but i never use it so i maybe shouldnt say that
hennesse
07-21-2014, 02:44 AM
try edit in a text editor lik notepad. i realy thik this is a flaw in dw template system but i never use it so i maybe shouldnt say that
Thanks. I thought of another way:
<img src="up-arrow.gif" onClick='document.location="../index.html"' />DW updates the path to up-arrow.gif, but does NOT mess with the inline Javascript
A little clumsier, but it seems to work.
Dave
good. cant resist saying you should maybe look at using includes rather than dw templates, just so much easier to update or change without site wide changing. I really just dont like them :)
Ricky55
07-21-2014, 04:46 PM
Its more a limitation of templates than a bug.
Dreamweaver basically just corrects paths to make them relative from the template.
I wouldn't use this method if you can help it. Relying on javascript to just get a link working isn't the best idea.
If you can I would really try to use includes as Ed suggests.
If you don't want to use PHP for a static site thats understandable. In this case you could look at using an app like Codekit of Hammer. These provide include like functionality without PHP.
Personally I always use PHP as it always comes in handy for other things even on a static site.
HTH
dont forget the include using object as a option also
<object name="foo" type="text/html" data="foo.txt"/>
or simple javascript
<script type="text/javascript" src="include_html.js"></script>
vBulletin® v3.8.7, Copyright ©2000-2019, vBulletin Solutions, Inc.