Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-23 13:13:25

kory
New Member
Registered: 2007-05-23
Posts: 2

"home" link on nav doesn't return to root page...

Howdy all. First post here. I’ve read through the “how do I?” and wiki after trying a forum search but couldn’t find an answer. I’m hoping someone might be able to help me out.

For some reason, my top level nav bar’s “home” link doesn’t return me to the site’s root index page. It’ll return me to the category’s root page instead, although the path is http://testing.com/staging/ For example, based on the code below, if I click on the “home” link but was previously within the “sheep” category, the link will return me to “sheep“category home page and not the site home page.

Here’s a sample of my nav bar:

<!— navtop —>
<div class=“navcontainer”>
<ul>
<li><a href=”<txp:link_to_home />” title=“Back to main page [1]” accesskey=“1”>Home</a></li>
<li><a href=”<txp:link_to_home />about/” title=“About Us [a]” accesskey=“a”>About</a></li>
<li><a href=”<txp:link_to_home />news/” title=“Company News [n]” accesskey=“n”>Company News</a></li>
<li><a href=”<txp:link_to_home />contact/” title=“Contact Us [9]” accesskey=“9”>Contact</a></li>
<li><a href=”<txp:link_to_home />kennel/” title=“Kennel”>Kennel</a></li>
<li><a href=”<txp:link_to_home />cabin/” title=“Cabin”>Cabin</a></li>
<li><a href=”<txp:link_to_home />sheep/” title=“Sheep”>Sheep</a></li>
</ul>
</div>
<!— navtop —>

I’ve tried taking out the “accesskey” code but got the same results.

If anyone has any suggestions on what I’m doing wrong, I’d greatly appreciate it!

Regards,
Kory

Offline

#2 2007-05-23 15:17:27

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: "home" link on nav doesn't return to root page...

Why do you need the link_to_home tag at all? Won’t this do….

<!— navtop —>
<div class="navcontainer”>
<ul>
<li><a href="/” title="Back to main page [1]" accesskey="1">Home</a></li>
<li><a href="/about/" title="About Us [a]" accesskey="a">About</a></li>
<li><a href="/news/" title="Company News [n]" accesskey="n">Company News</a></li>
<li><a href="/contact/" title="Contact Us [9]" accesskey="9">Contact</a></li>
<li><a href="/kennel/" title="Kennel">Kennel</a></li>
<li><a href="/cabin/" title="Cabin">Cabin</a></li>
<li><a href="/sheep/" title="Sheep">Sheep</a></li>
</ul>
</div>
<!— navtop —>

Works for me.

Last edited by FireFusion (2007-05-23 15:21:48)

Offline

#3 2007-05-23 15:25:21

kory
New Member
Registered: 2007-05-23
Posts: 2

Re: "home" link on nav doesn't return to root page...

Thx, FireFusion. I think I’m overcomplicating things with TextPattern. :-) Works for me too.

I appreciate it!

Regards,
Kory

Offline

#4 2007-05-24 02:50:11

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

Re: "home" link on nav doesn't return to root page...

This should work:

<!-- navtop -->
<div class="navcontainer">
	<ul>
		<li><a href="<txp:site_url />" title="Back to main page [1]"  accesskey="1">Home</a></li>
		<li><a href="<txp:site_url />about/" title="About Us [a]" accesskey="a">About</a></li>
		<li><a href="<txp:site_url />news/" title="Company News [n]" accesskey="n">Company News</a></li>
		<li><a href="<txp:site_url />contact/" title="Contact Us [9]" accesskey="9">Contact</a></li>
		<li><a href="<txp:site_url />kennel/" title="Kennel">Kennel</a></li>
		<li><a href="<txp:site_url />cabin/" title="Cabin">Cabin</a></li>
		<li><a href="<txp:site_url />sheep/" title="Sheep">Sheep</a></li>
	</ul>
</div>
<!-- navtop -->

But, so should using link_to_home. Can you give an example of the actual URLs it was returning? (If you right-click on the link and choose “Properties”, or, in the status bar when you mouse over the link.)

Offline

Board footer

Powered by FluxBB