Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-06-05 20:47:54
- kmaven
- New Member
- Registered: 2007-06-04
- Posts: 8
Nav Not Pointing To Pages
Hi, I just finished putting a theme on my TXP Blog (talk about a pain). Anyway, I noticed that that nav system was not pointing to the right pages. (I had to set Permanent link mode to messy, because I’m not sure if i have mod-rewrite with the server I am working with).
For example: The link to the About Us page is: www.mydomain.com/chat/index.php?id=2. Which works.
But when I click on my nav menu I get: www.mydomain.com/about/
I looked at the nav code and saw the problem:
<div id=“navigation”>
<h3 class=“hidden”>Navigation</h3>
<ul>
<li class=“nav1”><a title=“Return to Home” href=”/” accesskey=“1”>Home</a></li>
<li class=“nav2”><a title=“About This Site” href=”/about/” accesskey=“2”>About</a></li>
<li class=“nav3”><a title=“Contact Me” href=”/contact/” accesskey=“3”>Contact</a></li>
</ul>
</div>
So my question is: How do I get the links (<a href) to be correct?
Offline
#2 2007-06-05 20:59:44
- kmaven
- New Member
- Registered: 2007-06-04
- Posts: 8
Re: Nav Not Pointing To Pages
P.S. The site is also not creating the Top Level Nav system like I need it to?
Offline
Re: Nav Not Pointing To Pages
Hi, the problem [EDIT: for the first issue] lies with how the template is authored as the link targets are hard-coded (the reason I guess was to provide accesskey options). You need to replace the href="/about/"
to href="/chat/index.php?id=2"
and so on replacing the hard-coded href links for each of your menu links with the one’s that are correct. This is still hard-coded, though so if you change back to non-messy URLs you’ll have to change it back.
If your menu directs to sections you can use txp:section_list. If your menu is hand-made and directs to individual articles rather than sections (which I guess it is from your example), then you could use txp:permlink together with the attribute id="{article-id#}"
to build a link that points to an individual txp article (see the textbook entry linked for how to construct your own permlink formats).
[EDIT: to help you with the second problem, you have to say what you want and what it’s currently doing differently]
Last edited by jakob (2007-06-05 21:02:40)
TXP Builders – finely-crafted code, design and txp
Offline
#4 2007-06-05 21:05:09
- kmaven
- New Member
- Registered: 2007-06-04
- Posts: 8
Re: Nav Not Pointing To Pages
For the second problem:
Usually when I go to Presentation > Sections, I can create a new section and it will make a new static page for the site and also generate a link in the main nav system. It’s not doing that this time around.
Offline
#5 2007-06-05 21:08:41
- kmaven
- New Member
- Registered: 2007-06-04
- Posts: 8
Re: Nav Not Pointing To Pages
Also, my menu does redirect to section, but how would I be able to put section_list in the nav. How would that work from the about section, contact section, other section, etc.
Offline
Re: Nav Not Pointing To Pages
If you look at the examples in the textbook for txp:section_list (linked) you can use it to automatically create a similar menu using an unordered list that will automatically include new sections should you add them later: <txp:section_list break="li" wraptag="ul" />
. You just need to put that in your navigation div.
Note that it won’t be entirely identical to the navigation used in your template, in particular it won’t have access keys and different classes for each nav item, so you may need to adapt the css to fit. The template you’ve used was obviously not built with automatic adaptability in mind.
TXP Builders – finely-crafted code, design and txp
Offline
Pages: 1