Go Back   TechArena Community > Technology > Technology & Internet
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



How do I get the URI of the current web page from my Drupal theme?

Technology & Internet


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-01-2010
Member
 
Join Date: Jun 2009
Posts: 56
How do I get the URI of the current web page from my Drupal theme?

Hi,
I have a website content development and web designing. And I this web site I need to create a drupal structure with the home page and up to 3 internal page templates. All the image and graphic work done in the Photoshop and CorelDraw, using this site I want to uploaded some text data with the additional pages and also I want to manage all the content of this site and in my requirement I want to get the URI of the current web page from my Drupal theme? So please share your knowledge with me
Reply With Quote
  #2  
Old 28-01-2010
Techno01's Avatar
Member
 
Join Date: Apr 2008
Posts: 2,269
Re: How do I get the URI of the current web page from my Drupal theme?

Hey I tell you about the Uniform Resource Identifier (URI),Uniform Resource Identifier is a is a string of characters and it is use to identify a name or a resource on the Internet. Uniform Resource Identifier help to identify and enables interaction with representations of the resource over a network, with the help of some protocols. These protocols are concrete syntax and associated protocols define each URI. I think this information will increase your Uniform Resource Identifier (URI) knowledge.
Reply With Quote
  #3  
Old 28-01-2010
Techguru01's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,118
Re: How do I get the URI of the current web page from my Drupal theme?

Hey used following in this code you get your own URL link, this code mostly use for “Back to Top” and same like this but following code is for “Back to Top” code, you able to edit this code.
This is PHP code:
Quote:
<a href="/<?php print url($_GET['q'], NULL, NULL, TRUE); ?>#top">your message </a
This is DRUPAL code:
Quote:
drupal_get_path_alias(reqURI())
This code will work on all types of version
Quote:
$your_current_url = "http://" .$_SERVER['HTTP_HOST'].$_SERVER['REQURI'];
__________________
I'm the Proud Owner of the most dangerous weapon
known to man kind: Human Brain
Reply With Quote
  #4  
Old 28-01-2010
deveritt's Avatar
Member
 
Join Date: Apr 2008
Posts: 2,525
Re: How do I get the URI of the current web page from my Drupal theme?

I think you have to use this following code because you use drupal theme and in your requirement you have to use drupal theme for URI retrieving, I use this same code successfully with my drupal theme.
Quote:
<?php
function reqURI() {

if (isset($_SERVER['REQURI'])) {
$uri = $_SERVER['REQURI'];
}
else {
if (isset($_SERVER['argv'])) {
$uri = $_SERVER['SRPTNAME'] .'?'. $_SERVER['argv'][0];
}
else {
$uri = $_SERVER['SRPTNAME'] .'?'. $_SERVER['QUERY_STRING'];
}
}
$uri = '/'. ltrim($uri, '/');

return $uri;
}
?>
Reply With Quote
  #5  
Old 28-01-2010
Trio's Avatar
Member
 
Join Date: May 2008
Posts: 2,754
Re: How do I get the URI of the current web page from my Drupal theme?

Hey following codes are use for test and then decide for implement.
Quote:
$curr_uri = check_plain(request_uri());
If you don’t use the check_plan in your code then use following code and using following code you can get the Drupal page URI like this:
Quote:
$curr_uri = request_uri();
but my suggestion for you to use check_plain method, it will help you to URI is properly encoded.
Reply With Quote
Reply

  TechArena Community > Technology > Technology & Internet


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How do I get the URI of the current web page from my Drupal theme?"
Thread Thread Starter Forum Replies Last Post
develop web report: display Current page and Total pages freezea Software Development 1 25-05-2011 01:03 AM
My current home page doesn't display on desktop matbiec Window 2000 Help 2 29-12-2010 12:40 AM
How to find out Current Page Url with the help of JavaScript? Kushan Software Development 3 21-11-2009 10:40 AM
Your current Security Settings prohibit running ActiveX Controls on this page outlook Vasudhara Windows Software 4 20-08-2009 01:13 PM
Is it possible to get the current URL in my JSP page Sean J Software Development 3 19-05-2009 10:27 PM


All times are GMT +5.5. The time now is 05:56 AM.