drupal-6


arg function not using URL alias


I am running Drupal 6, and I'm using PHP for block visibility.
<?php
$city = arg(0);
$page = arg(1);
if ($city == 'tampa' && $page != 'art'){
return 'TRUE';
}
else{
return FALSE;
}
?>
I was having trouble with this block of code, so I decided to insert:
<?php print arg(0).arg(1); ?>
in my page.tpl.php. What I found was that on some of my pages, arg(0) was showing 'node' when the URL is actually 'tampa', and of course, arg(1) is showing the node ID.
However, on other pages, such as my calendar, arg(0) is actually showing 'tampa' instead of 'node'.
I have used this a lot in the past, and have never had this problem. Is there a reason why Drupal is disregarding my aliases on certain pages? If so, how can I fix it?
I didn't get any responses on this, but I worked out a hack.
$path = 'node' . "/" . $node->nid;
drupal_get_path_alias($path);
from there I was able to use PHP string parsing functions to get the actual alias.

Related Links

Lot of spams on drupal 6 site with reCaptcha module [closed]
get data from just created node and pass it to url
how to a translatable string in drupal theme?
How to create node of particular content type from webform results?
Need to export drupal comments to disqus
How to add js file in footer in drupal6?
how to include jwplayer in drupal site
Is it possible to combine two hook_preprocess functions into one in drupal 6
How to access cck fields in tpl file?
drupal 6 authenticated user
Show drupal node along with comments for iphone app
Drupal removing a node reference from a node
how to increase the upload term limit of taxonomy csv module
(upload_fid) Drupal token
How to redirect a user to profile page after one time login in drupal
What will be the post parameter when specifying vocabulary term?

Categories

HOME
pdf
openlayers
gitlab
deployment
vbscript
cookies
pycharm
plone
office365api
syntax
react-router
android-4.4-kitkat
framework7
bookshelf.js
amazon-ecs
append
awesome-wm
phaser
ibm-odm
quickfix
foselasticabundle
django-admin
oxyplot
one-hot-encoding
mps
google-search-api
php-openssl
sqlcipher
facet
kannel
wtx
webkitspeechrecognition
vision
microsoft-chart-controls
create-table
catch-all
mozilla
webix-treetable
leading-zero
azure-ml
optix
fedex
spring-security-kerberos
pubmed
rails-routing
promela
mu
git-diff
elgg
namecoin
pillow
nbconvert
account-kit
query-performance
eventkit
py2app
simplewebrtc
make-install
php-parse-error
two-factor-authentication
freelancer.com-api
natvis
vhd
lib.web.mvc
intellij-14
cannon.js
riak-cs
php-ci
dundas
bridge.net
directoryservices
website-monitoring
xc16
codeigniter-url
nsbutton
mesa
navigationservice
yorick
valueconverter
viadeo
excel-2003
cos
chronoforms
enterprisedb
jquery-knob
coderush
appconkit
ohm
jquery-ui-layout
external-accessory
gcj
yetanotherforum
table-footer
asp.net-mvc-areas
xsdobjectgen
ext3
rescale
iweb
simpletest
premature-optimization
sustainable-pace
genealogy
ubuntu-9.04
w3wp
multiple-languages

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App