Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-18 22:21:51

simon123
New Member
Registered: 2009-06-18
Posts: 3

links going nowhere

Hello, I have a problem that despite spending hours looking through the textpattern information I can’t find the answer to. On my site I have section links at the top that says: Home, Archives. Links, About. The Home button works, but the others go to: mysite.com/archives/ or mysite.com/about/ etc. The trouble is that there isn’t anywhere for these links to go to, so I get the message:

The requested URL /archives/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I’ve tried creating sections for these pages but nothing happens. The links page and About could be a static page but the Archives page needs to be sorted out by Textpattern, pulling up a list of all the archived links, doesn’t it?

Can someone point me in the right direction?

Offline

#2 2009-06-18 22:41:54

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

Re: links going nowhere

Have you looked at your site’s diagnostics? If you have a clean URL error, that could be the problem. Switching to “messy” mode would be a quick solution.


Code is topiary

Offline

#3 2009-06-18 22:54:06

simon123
New Member
Registered: 2009-06-18
Posts: 3

Re: links going nowhere

Thank you for your reply. I am currently using messy url because the clean ones didn’t work at all. I was suspicious that is might be the problem because the urls to the sections look clean but thought maybe they were a different kind of thing.

In the code it says: <li><a class=“selected” href=”/”>Home</a></li> <li><a href=”/archives/”>Archives</a></li> <li><a href=”/links/”>Links</a></li> <li><a href=”/about/”>About</a></li>

but there is no /archives/ directory etc. on the host server so the pages can’t go anywhere.

I’m totally confused because I thought textpattern would automatically create an archives page.

Offline

#4 2009-06-18 23:19:42

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

Re: links going nowhere

Txp sections don’t actually correspond to directories on the server — it’s all .htaccess magic. Are you using a template? The href values for the links you show require a “clean” URL mode. When you say “in the code”, are you talking about HTML page source, or a Txp Page or Form? At any event, in messy mode section links need href values something like: href="/?s=archives". If your section links are created using Txp tags, the tags will automatically use the correct URL mode. If you are hard-coding the links with HTML markup, you’ll need to match the URL mode.


Code is topiary

Offline

#5 2009-06-18 23:42:00

simon123
New Member
Registered: 2009-06-18
Posts: 3

Re: links going nowhere

I am using a template, MX4 by Michael of MX4. There was a zip file to download and the instructions were:

1. The MX4 theme requires only two page templates, one for the home page (with a sidebar) and a single-column template for individual articles.

Therefore, once you have logged into your Admin area, go to “presentation/pages” and copy the contents of the “default.txt” file in the folder: “pages”. Then, copy the default page template as “article” using the form at the bottom of the template display and then select the new page template and copy the contents of the “article.txt” file into it. Again, ensure that you are copying the contents of “article.txt” into the “article” template and not the “default”.

2. Now go to the “presentation/style” and copy the contents of the CSS.txt file into the default CSS and press save.

3. There are four text files in the “forms” folder. The MX4 theme does not require the creation of new forms, therefore the contents of each text file should be copied to the corresponding form in the admin panel.

4. Only two sections are required, however more can be added as necessary. The required sections are “article” and “about” which should already be created. After going to the “Presentation/Section” area, change both the “article” and “about” sections to “article” under “uses page”. Make sure that you save each change individually using the save button under each section’s description. This ensures that the articles use the single-column template.
Images

5. Simply upload the files in the “images” directory into the images directory on your server.

I have done all this, and changed some of the images to fit the style of my intended site but I can’t work out how to get the links at the top to link to actual pages, like an achive list of posts.

Offline

#6 2009-06-19 00:17:36

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

Re: links going nowhere

OK, I’ve just had a look over the MX4 template. The “section” links are hard coded. The link to “archives” is a dummy link and doesn’t go anywhere — I can only guess there is supposed to be some javascript to go along with it, but there is no js in the template. Hard-coded section links is also not a good sign, frankly — this should be done using Txp tags. Try replacing this:

<a href="/about/">About</a>

with this:

<txp:section link="1" title="1" />

in both the default and article pages (templates).

That should at least get you a working link to your “about” section.

Edit: Sorry, should have been

<txp:section link="1" title="1" name="about" />

alternately

<txp:section name="about">About</txp:section>

Last edited by jsoo (2009-06-19 11:08:33)


Code is topiary

Offline

#7 2009-06-19 00:19:13

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

Re: links going nowhere

While you’re at it, replace <txp:sitename /> with <txp:site_name /> in both pages.


Code is topiary

Offline

#8 2009-06-19 11:20:45

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

Re: links going nowhere

Best choice for most cases is to use “ <txp:section_list /> to automatically generate all the links at once. Something like this:

<txp:section_list include_default="1" default_title="Home" wraptag="ul" break="li" active_class="selected" />

Code is topiary

Offline

Board footer

Powered by FluxBB