I am trying to do the following but having issues. I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp or www.domain.com/yepp/page1 If I try using arg(0) it just returns the internal system path "node". Any help would be greatly appreciated. Thank you -- Chris McCreery
On Fri, Aug 27, 2010 at 9:56 PM, Chris McCreery <chris.mccreery@gmail.com>wrote:
I am trying to do the following but having issues.
I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp or www.domain.com/yepp/page1
If I try using arg(0) it just returns the internal system path "node".
There is more than one way of doing this. Here is a simple one: $a = explode('/', check_plain($_SERVER['REQUEST_URI'])); if ($a[1] == 'yepp') { // Go wild } -- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting. Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra Simplicity is the ultimate sophistication. -- Leonardo da Vinci
Would have to try it, but you might have to pass the drupal path through the http://api.drupal.org/api/function/drupal_get_path_alias/6 function first, and then do a text search for yepp Victor Kane http://awebfactory.com.ar On Fri, Aug 27, 2010 at 11:07 PM, Khalid Baheyeldin <kb@2bits.com> wrote:
On Fri, Aug 27, 2010 at 9:56 PM, Chris McCreery <chris.mccreery@gmail.com>wrote:
I am trying to do the following but having issues.
I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp or www.domain.com/yepp/page1
If I try using arg(0) it just returns the internal system path "node".
There is more than one way of doing this.
Here is a simple one:
$a = explode('/', check_plain($_SERVER['REQUEST_URI'])); if ($a[1] == 'yepp') { // Go wild }
-- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting. Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra Simplicity is the ultimate sophistication. -- Leonardo da Vinci
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Any downfall to using this? $path = drupal_get_path_alias($_GET['q']); if (strlen(strstr($path,'yepp'))>0): ?> On Fri, Aug 27, 2010 at 10:12 PM, Victor Kane <victorkane@gmail.com> wrote:
Would have to try it, but you might have to pass the drupal path through the http://api.drupal.org/api/function/drupal_get_path_alias/6 function first, and then do a text search for yepp
Victor Kane http://awebfactory.com.ar
On Fri, Aug 27, 2010 at 11:07 PM, Khalid Baheyeldin <kb@2bits.com> wrote:
On Fri, Aug 27, 2010 at 9:56 PM, Chris McCreery <chris.mccreery@gmail.com
wrote:
I am trying to do the following but having issues.
I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp or www.domain.com/yepp/page1
If I try using arg(0) it just returns the internal system path "node".
There is more than one way of doing this.
Here is a simple one:
$a = explode('/', check_plain($_SERVER['REQUEST_URI'])); if ($a[1] == 'yepp') { // Go wild }
-- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting. Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra Simplicity is the ultimate sophistication. -- Leonardo da Vinci
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
-- Chris McCreery
Try it. Do some debugging print_r($path) dsm($path) etc. Knock yourself out. On Fri, Aug 27, 2010 at 11:40 PM, Chris McCreery <chris.mccreery@gmail.com>wrote:
Any downfall to using this?
$path = drupal_get_path_alias($_GET['q']); if (strlen(strstr($path,'yepp'))>0): ?>
On Fri, Aug 27, 2010 at 10:12 PM, Victor Kane <victorkane@gmail.com>wrote:
Would have to try it, but you might have to pass the drupal path through the http://api.drupal.org/api/function/drupal_get_path_alias/6 function first, and then do a text search for yepp
Victor Kane http://awebfactory.com.ar
On Fri, Aug 27, 2010 at 11:07 PM, Khalid Baheyeldin <kb@2bits.com> wrote:
On Fri, Aug 27, 2010 at 9:56 PM, Chris McCreery < chris.mccreery@gmail.com> wrote:
I am trying to do the following but having issues.
I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp or www.domain.com/yepp/page1
If I try using arg(0) it just returns the internal system path "node".
There is more than one way of doing this.
Here is a simple one:
$a = explode('/', check_plain($_SERVER['REQUEST_URI'])); if ($a[1] == 'yepp') { // Go wild }
-- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting. Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra Simplicity is the ultimate sophistication. -- Leonardo da Vinci
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
-- Chris McCreery
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
This should do what you want, without being overly complicated: $arguments = explode('/', request_uri()); if (in_array('yepp', $arguments)) { // Insert div } As an added bonus, 'request_uri()' is a Drupal function: http://api.drupal.org/api/function/request_uri/6 On 28/08/10 11:56, Chris McCreery wrote:
I am trying to do the following but having issues.
I would like to insert a specific div tag in my page.tpl.php when the url alias contains yepp for example when www.domain.com/yepp <http://www.domain.com/yepp> or www.domain.com/yepp/page1 <http://www.domain.com/yepp/page1>
If I try using arg(0) it just returns the internal system path "node".
Any help would be greatly appreciated.
Thank you
-- Chris McCreery
_______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
-- Kind regards, Peter Anderson. http://panda.id.au
participants (4)
-
Chris McCreery -
Khalid Baheyeldin -
Peter Anderson -
Victor Kane