Forum Moderators: open
<a href='/homepage.aspx'>Homepage</a>
<a href='/homepage.aspx?sub=sub1'>Sub Section 1</a>
<a href='/homepage.aspx?sub=sub2'>Sub Section 2</a>
Is it possible to turn "homepage.aspx" into some sort of relative value that href understands? My goal is to make this set of links generic so that I can place them in a SSI file instead of having to hardcode each page name into each link when all I want to really reference are the same div's in each page.
So something like:
<a href='/X'>Homepage</a>
<a href='/X?sub=sub1'>Sub Section 1</a>
<a href='/X?sub=sub2'>Sub Section 2</a>
where 'X' represents "homepage.aspx" in this instance.
Hrefs are not resolved by SSI or your server, they are resolved by the client (browser). So the fact that the links are included as HTML text by SSI has no effect on the links.
Jim
I have a bunch of different pages (page001.html to page100.html). Each page contains the same divisions (div1, div2, div3), the links in each page then reference each division to I can jump to those sections.
page001.html contains:
<a href='/page001.html?sub=div1'>Div 1 content</a>
<a href='/page001.html?sub=div2'>Div 2 content</a>
<a href='/page001.html?sub=div3'>Div 3 content</a>
page002.html contains:
<a href='/page002.html?sub=div1'>Div 1 content</a>
<a href='/page002.html?sub=div2'>Div 2 content</a>
<a href='/page002.html?sub=div3'>Div 3 content</a>
page003.html contains:
<a href='/page003.html?sub=div1'>Div 1 content</a>
<a href='/page003.html?sub=div2'>Div 2 content</a>
<a href='/page003.html?sub=div3'>Div 3 content</a>
and so on. What I want to do is replace the "page00n.html" with a non-specific path so I can create my 100 pages without having to rename 3 links per page.
Is there no way to essentially say "href='(the current page Im at).html'
Maybe Im going about this the wrong way? Could I use something like href="pointer" and give a div the name="pointer" attribute somehow?