Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-16 19:27:44

hubie
New Member
From: Toronto, Ontario, Canada
Registered: 2007-08-16
Posts: 3

problem with links from home page to various sections

I just started trying to integrate a site I was making into a more dynamic site with textpattern. Getting textpattern set up and running seems to have gone fine but I can’t get my navigation working properly.

I made a header form to contain my navigation. I replaced the html references with textpattern section tags like this

<ul id=“nav”>
<li id=“news”><a href=”<txp:section name=“news” />” title=“Find out what’s new”>news</a></li>
</ul>

Then I made corresponding sections so the link would have somewhere to go.

When I click my link it takes me to “localhost/user/sitename/news” but none of the page or styling preferences are there. I’m testing it on my local machine using messy urls.

I thought maybe I was using the section tags incorrectly. It’s probably something simple but after fiddling with it for a few days I am still puzzled.

Any ideas would be appreciated. Thanks.

Offline

#2 2007-08-16 19:37:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: problem with links from home page to various sections

hubie wrote:

I thought maybe I was using the section tags incorrectly.

No, the tag is used correctly. Better would be <a href="<txp:site_url /><txp:section name="news" />" title="Find out what's new">news</a>. (The site url is set in Admin > Preferences.)

Under Presentation > Sections you can assign page templates and styles to sections. Are you sure that the section ‘News’ is set to use the right template and style?

Offline

#3 2007-08-16 20:57:06

hubie
New Member
From: Toronto, Ontario, Canada
Registered: 2007-08-16
Posts: 3

Re: problem with links from home page to various sections

Els wrote:

Are you sure that the section ‘News’ is set to use the right template and style?

Hmm, in the presentation sections menu I did change the “Uses Page” and “Uses Style” to the right template and style. I did change the code to the format you showed me. That did make much more sense.

All that shows up on the generated page is header text, links (but not the ones I am using) and the footer text. The home page has adopted the styles and page information correctly though. I guess the paths could be messed up somehow but the diagnostic doesn’t indicate where that could be occurring – it claims everything is fine.

Offline

#4 2007-08-16 21:39:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: problem with links from home page to various sections

Try if this FAQ helps: Diagnosing template problems. If not, can you post a tag trace as explained there?

Offline

#5 2007-08-16 21:58:06

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: problem with links from home page to various sections

You’re using messy urls, so those urls won’t work properly. There’s no point using the section tag here, since you have to input the name anyway (which is what is used in the URL).

<ul id="nav">
	<li id="news"><a href="<txp:site_url />?s=news" title="Find out what's new">news</a></li>
</ul>

Offline

#6 2007-08-16 23:03:32

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: problem with links from home page to various sections

alternatively you can utilize the txp:section_list tag to output whichever sections you want in a specified order. it will also adapt to the type of url you’re using.

Last edited by iblastoff (2007-08-16 23:05:07)

Offline

#7 2007-08-17 00:17:05

hubie
New Member
From: Toronto, Ontario, Canada
Registered: 2007-08-16
Posts: 3

Re: problem with links from home page to various sections

Thanks very much. I made some test pages and sections and altering my syntax to take into account my use of the messy urls did fix the navigation problem. I will try the section list tag as well and see which will be most suitable.

Offline

Board footer

Powered by FluxBB