Link to home
Start Free TrialLog in
Avatar of arthur_raft2
arthur_raft2Flag for Australia

asked on

Conditional Link URL - Easy Question

Take a look at the following script.
A small block of links that will apear on various different pages.

The logic should be fairly simple to follow.

I need the link target addresses to vary according to the page or content that contains these links.

This might be based on URL?
It could also be based on some identifier or class contained in the surrounding content

Simpler the better - i.e, cSS. Javascrip if necessary.

Any suggestions ?


<table  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a href=" if current page = A, then link = B "><a href=" if current page = C, then link = D ">Text 1</a></a></td>
    <td><a href=" if current page = E, then link = F "><a href=" if current page = G, then link = H ">Text 2</a></a></td>
    <td><a href=" if current page = I, then link = J "><a href=" if current page = K, then link = L ">Text 2</a></a></td>
  </tr>
</table>
Avatar of Dr. Klahn
Dr. Klahn

In Apache, nginx, or IIS?
ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did this answer your question?