Page link works on home page but not on others
Permalink 1 user found helpful
Gawd!! My third question today!!
This site is nearly finished but just when I thought it was safe...
It's a 3 column layout and they need a link to their Code of Conduct page to permanently appear in the right hand column on every page of the site.
So I went into default.php and added this:
<div id="right-column">
<h2> <a href="code-of-conduct">ACRA Code of Conduct</a></h2>
etitable area here etc etc...
Now this works great on the home page but when I click on the link from another page, e.g. faq page - it tries to go to /faq/code-of-conduct which of course doesn't exist because the page is under the home page.
I have pretty URLs enabled suspect this may be something to do with it. Or do I have to alias the page under all the others or something?
Any advice greatly appreciated as always.
Thanks
Al
This site is nearly finished but just when I thought it was safe...
It's a 3 column layout and they need a link to their Code of Conduct page to permanently appear in the right hand column on every page of the site.
So I went into default.php and added this:
<div id="right-column">
<h2> <a href="code-of-conduct">ACRA Code of Conduct</a></h2>
etitable area here etc etc...
Now this works great on the home page but when I click on the link from another page, e.g. faq page - it tries to go to /faq/code-of-conduct which of course doesn't exist because the page is under the home page.
I have pretty URLs enabled suspect this may be something to do with it. Or do I have to alias the page under all the others or something?
Any advice greatly appreciated as always.
Thanks
Al
$this->url('code-of-conduct');
Thanks Mnkras, for all your help today.
Not very PHP savvy I'm afraid - where do I put that bit of code?
Does it replace the php echo bit or...
I have tried this:
<a href="<?php echo DIR_REL ?>$this->url('code-of-conduct');">ACRA Code of Conduct</a>
and this:
<a href="<?php $this->url('code-of-conduct');">ACRA Code of Conduct</a>
and this:
<a href="<?$this->url('code-of-conduct'); ?>">ACRA Code of Conduct</a>
But none are working
Thanks
Al
Not very PHP savvy I'm afraid - where do I put that bit of code?
Does it replace the php echo bit or...
I have tried this:
<a href="<?php echo DIR_REL ?>$this->url('code-of-conduct');">ACRA Code of Conduct</a>
and this:
<a href="<?php $this->url('code-of-conduct');">ACRA Code of Conduct</a>
and this:
<a href="<?$this->url('code-of-conduct'); ?>">ACRA Code of Conduct</a>
But none are working
Thanks
Al
<?php echo $this->url('code-of-conduct'); ?>
If that doesn't work, copy the url that is being put into the href and paste it here so we can see what's going on.
That worked perfectly thank you!
:)
:)
On the default.php, instead of having
<a href="code-of-conduct">
I made it this:
<a href="<?php echo DIR_REL?>/index.php/code-of-conduct">
Thing is, it puts the full url in the address bar, but at least it's working.