The Artima Developer Community
Sponsored Link

PHP Buzz Forum
Syntax 1.2: NavPath vs Url Path

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Forum One

Posts: 118
Nickname: forumone
Registered: Sep, 2004

Forum One is consulting firm specializing in helping non-profits improve their online presence.
Syntax 1.2: NavPath vs Url Path Posted: Feb 23, 2005 12:50 PM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Forum One.
Original Post: Syntax 1.2: NavPath vs Url Path
Feed Title: Syntax Framework
Feed URL: http://blog.syntaxcms.org/rss.php?version=0.91
Feed Description: Finally, a place to answer Syntax questions
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Forum One
Latest Posts From Syntax Framework

Advertisement

Once Syntax 1.2 is released, some confusion may arise from two similar methods within the Section object. Remember, sections are essentially the pages on your site. With the nice cleanup of URL paths that Sandy worked on, sections now have a method called getUrlPath(). They have for some time now, had a method called getNavPath. So, what exactly is the difference and when do you use or need each one?

First, getUrlPath() returns the full, complete, and unique path to the section including it's root node. Typically, the root node is the homepage of your site and is named _home. A sample URL Path would be _home/about/contact_us. URL Paths can be used to get a section object by calling Section::getByUrlPath( _home/about/contact_us ).

In comparison, getNavPath() returns the part of the URL Path needed to navigate to a section on a web page. Essentially, it removes the root element for your site set by the constant NAV_ROOT_EL in config/static.conf.php. In the example above, calling getNavPath() for your section would return '/about/contact_us. To build a link to that page on a template, you'd use the following code:

echo "<a href=\"/section".$section->getNavPath()."\">"

Read: Syntax 1.2: NavPath vs Url Path

Topic: WordPress 1.5 Previous Topic   Next Topic Topic: Davey v.s. OSI Hosting

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use