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

How to place a cck field inside a fieldset?
How to display the maxlength countdown remaining characters for custom form fields
How to put the field label inside the form select field?
Symbol “?” in alias or Dirty url
hook_comment not modifying data
How to use php session in drupal 6
Drupal 6, Create a form in a node which save data to another content type (cck)
Synchronize language switcher with language from user profile
How to replace fckeditor with CKeditor?
rel=nofollow does not add to the links in my CCK field
Get term name by term id
Custom Contact Form on a Drupal CCK Node
Drupal 6, FAPI form submitted twice, why?
problem with notifications module in drupal
drupal 6, FAPI, many instances of the same form in the same page but only the first is submitted
Importing Drupal 5 content into Drupal 6

Categories

HOME
cloud
gerrit
tizen
reserved
mfc
hashmap
vmware
sd-card
at-command
react-redux
v8
blueprintjs
wamp
azure-media-services
basic
google-translate
collectd
leiningen
jsprit
tostring
transformation
emulator
grails3
cloudhub
functional-testing
extjs5
tibco-mdm
wpfdatagrid
brunch
uninstall
junit5
oracle-fusion-middleware
fog
lxd
geopositioning
http-referer
mmenu
bytecode-manipulation
http-digest
io-redirection
unobtrusive-validation
g-code
total-commander
jquery-validate
aurelia-validation
spring-cache
dynamics-sl
visual-c++-2008
firmata
url-pattern
deadbolt-2
gridpane
phishing
skobbler-maps
fuzzy-search
fputcsv
skype4py
cloudbees
intel-fortran
dukescript
ionic
interrupted-exception
event-bubbling
sailfish-os
sankey-diagram
ami
angular-local-storage
android-imagebutton
phalanger
mdt
html-helper
bitcoinj
tld
navigationservice
elliptic-curve
yorick
rtmfp
typo3-neos
geos
shellexecute
android-hardware
google-email-migration
dice
newtonscript
jspinclude
bigcouch
work-stealing
external-accessory
cxxtest
sudzc
zend-translate
mozilla-prism
asp.net-profiles
substrings
mtj
pascal-fc
defensive-programming

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App