Pretty URLs and DIR_REL

Permalink
Howdy,

I'm looking for any input on the way I've done relative paths for a theme's navigation anchors. My original issue was that I couldn't get pretty URLs working on a dev server (solved that now), and this led me to find a way to handle relative paths that could have either pretty URLs off (for local development) or on (for production).

I came up with the following, which was based off of some code from the View->url() method. This code resides in my packages on_start() method (as I packaged my theme).

$dispatcher = '';
if( !defined( 'URL_REWRITING' ) || ( !URL_REWRITING ) ) {
  $dispatcher = '/' . DISPATCHER_FILENAME;
}
define( 'DIR_REL_INDEX', DIR_REL . $dispatcher );


This enabled me to use DIR_REL_INDEX in my theme's navigation anchors so that I didn't have to have additional code in the header.php/footer.php or page type files to handle pretty URLs being off or on.

I find this code interesting, though I'm not sure what use it has now that I have pretty URLs working on my dev server. Does anyone know if concrete already defines a similar constant? (DIR_REL is great, but it intentionally removes 'index.php', what I'd prefer is if it knew whether pretty URLs was on or not and then made the appropriate adjustment)

Anyways, thought I'd see what others' thoughts/knowledge on this is!

-Landson

Landson
 
goodnightfirefly replied on at Permalink Reply
goodnightfirefly
I'm having difficulty understanding why you would need to check the status of pretty URLs, can you explain your situation more?
pvernaglia replied on at Permalink Reply
pvernaglia
If you are using Autonav for your navigation you shouldn't have to do anything, It shoud pro with or without Pretu URLs