Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-14 20:39:10

jcca517
New Member
Registered: 2008-07-14
Posts: 8

Creating nav bars that function

I’m a very inexperienced user who’s trying to learn enough to fix a big problem: Entirely through fault of my own, I managed to overwrite a big hunk of my database. The site was developed (not by me, can you tell?) in 2006 on an earlier version of txp, so now as I try to put everything aright, there are glitchy bits that seem to come from different versions.

My site is designed to look and work something like a static-page site, so it’s got a top nav, and a left nav, and sometimes sub-navs. it should look and work like this: http://jessicaabel.com/index.php?id=3 for example.

However, in the section that I screwed up, this page http://jessicaabel.com/artbabe/ is meant to have a nav bar across the top, but it’s not showing up.

And then, this page http://jessicaabel.com/artbabe/index.php?s=soundtrack has a correct top nav, but with the subnav items under the main left nav, when you click on them, you get an error.

if you click the links you get sent to an address like this

http://jessicaabel.com/artbabe/soundtrack/5/contents

which obviously doesn’t work.

You should get sent to this

http://jessicaabel.com/artbabe/index.php?id=5

I tried rebuilding the part in the soundtrack page

<div class=“related_articles”>
<txp:article form=“subnav” pgonly=“0” searchall=“0” searchsticky=“0” status=“4” />
</div>

looks different, but same result. Could it be the result of the form? What am I missing?

thanks,

JA

Offline

#2 2008-07-14 20:42:00

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

Best post the contents of the form, and whatever you are using for your menus.

Offline

#3 2008-07-14 20:43:51

jcca517
New Member
Registered: 2008-07-14
Posts: 8

Re: Creating nav bars that function

ah, yes, here’s the “subnav” form

<li><a href=”<txp:permlink />”><txp:title /></a><txp:excerpt /></li>

Offline

#4 2008-07-14 20:44:53

jcca517
New Member
Registered: 2008-07-14
Posts: 8

Re: Creating nav bars that function

…and here’s the code for the menu

<!— head —>
<div id=“head”>
<div id=“logo”><a href=”/” alt=”“><img src=“http://www.jessicaabel.com/images/logo.gif” /></a></div> <div id=“navTest”> <ul> <li><a href=“http://www.jessicaabel.com” id=“menu_default”><span>&nbsp;</span></a></li> <li><a href=“http://www.jessicaabel.com/?s=work” id=“menu_work”>&nbsp;</a></li> <li><a href=“http://www.jessicaabel.com/?s=news” id=“menu_news”><span>&nbsp;</span></a></li> <li><a href=“http://www.jessicaabel.com/?s=speaking” id=“menu_speaking”><span>&nbsp;</span></a></li> <li><a href=“http://www.jessicaabel.com/?s=about” id=“menu_about”><span>&nbsp;</span></a></li> <li><a href=“http://www.jessicaabel.com/?s=shop” id=“menu_shop”><span>&nbsp;</span></a></li> </ul> </div>
</div>

Offline

#5 2008-07-14 20:55:34

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

Are all your sections using the same page (template)? What is the code for the sub menu that is not working?

Offline

#6 2008-07-14 20:59:59

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

First thing – in your /artbabe page, you are missing the doctype – this is missing:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

Offline

#7 2008-07-14 21:01:43

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

And there is a strange CSS reference in your /artbabe page:

<link rel="stylesheet" href="http://web.archive.org/web/20061213213226/http://www.jessicaabel.com/artbabe/textpattern/css.php?s=default" type="text/css" media="screen" />

Offline

#8 2008-07-14 21:11:49

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

Not sure what you are trying to accomplish with your related articles div, but assuming you are using TXP 4.06, your TXP tags can be cleaned up:

<div class=“related_articles”>
<txp:article form=“subnav” pgonly=“0” searchall=“0” searchsticky=“0” status=“4” />
</div>

Can become:

<div class=“related_articles”>
<txp:article form=“subnav” />
</div>

Remember that txp:article is context sensitive. If you wish to display articles outside of the current section, you will need to use txp:article_custom instead.

Offline

#9 2008-07-14 21:13:12

jcca517
New Member
Registered: 2008-07-14
Posts: 8

Re: Creating nav bars that function

A hah—that fixed the top nav, thank you!

that weird css is from the archive.org site that I had to go to in order to recover my lost pages…so sad.

As to the side menu, no, I’m not using all one template. There’s a home page (/artbabe), and then the sections have a slightly different template, so they can use this sub-menu thing, which isn’t working. This is an example of a section page. http://jessicaabel.com/artbabe/index.php?s=soundtrack . The code for the sub-menus is this, I think:

<div class=“related_articles”>
<txp:article form=“subnav” pgonly=“0” searchall=“0” searchsticky=“0” status=“4” />
</div>

but I admittedly could be wrong.

Offline

#10 2008-07-14 21:22:44

jcca517
New Member
Registered: 2008-07-14
Posts: 8

Re: Creating nav bars that function

FYI, the sections should be able to function more or less like this page: http://jessicaabel.com/laperdida/index.php?id=24

this one was made in the old version (4.0.3) of txp, however, and the code can’t just be cut-and-pasted. Believe me, I’ve tried.

Offline

#11 2008-07-14 21:29:54

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

On this page you have the following source code:

<div class="related_articles">
<li><a href="http://jessicaabel.com/artbabe/soundtrack/5/contents">Soundtrack&#160;contents</a></li><h2 id="comment"></h2>
<p>Commenting is closed for this article.</p>
</div>

Your subnav form could be:

<li><a href="<txp:permlink />" title="<txp:title />"><txp:title /></a><txp:excerpt /></li>

And in the page:

<div class=“related_articles”><txp:article_custom section="your section here" form=“subnav” /></div>

Offline

#12 2008-07-14 21:33:20

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Creating nav bars that function

jcca517 wrote:

FYI, the sections should be able to function more or less like this page: http://jessicaabel.com/laperdida/index.php?id=24
this one was made in the old version (4.0.3) of txp, however, and the code can’t just be cut-and-pasted. Believe me, I’ve tried.

I would recommend that you upgrade the site to 4.06 and then fix whatever still needs fixing…..

Offline

Board footer

Powered by FluxBB