Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-13 22:46:03

coleyparka
New Member
Registered: 2009-10-13
Posts: 8

My Nav Links Don't Work on Local Virtual Server

I have the following navigation on my homepage which I’m developing on my local machine:

<ul id=“nav”> <li id=“newslink”><a href=”/news”>News</a></li> <li id=“bandslink”><a href=”/bands”>Bands</a></li> <li id=“recordslink”><a href=”/records”>Records</a></li> <li id=“contactlink”><a href=”/contact”>Contact</a></li> <li id=“linkslink”><a href=”/links”>Links</a></li> <li id=“gigslink”><a href=”/gigs”>Gigs</a></li>
<li id=“videoslink”><a href=”/videos”>Videos</a></li> </ul>

When I try to navigate to them from the homepage I just get a “URL not found” message. However, if I add /?s=news /?s=bands etc at the end of the url it works. I have messy links on. Anyone got any thoughts on where I’m going wrong?

Cheers

Coleyparka

Offline

#2 2009-10-13 23:14:10

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: My Nav Links Don't Work on Local Virtual Server

For a URL such as /news to work you need to switch to a different permanent link mode, either /section/title or /section/id/title. And your local server needs to support “clean” URLs.

There would be some advantages to using the section_list tag rather than hard-coding the nav as you have done. For one, the URLs would automatically be correct no matter which permanent link mode you are using. For another you should be able to simplify that code. Something like this:

<ul id="nav">
<txp:section_list sections="news,bands,records,contact,links,gigs,videos">
<li id="<txp:section />link"><txp:section title="1" link="1" />
</txp:section_list>
</ul>

Code is topiary

Offline

#3 2009-10-14 16:00:44

coleyparka
New Member
Registered: 2009-10-13
Posts: 8

Re: My Nav Links Don't Work on Local Virtual Server

Thanks jsoo – that seems to have resolved the issue

Offline

Board footer

Powered by FluxBB