I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
I'm not sure I totally understand your question, but I'll tell you what works consistently for me with simplest possible set up on the server and no .htaccess or mod_rewrite complications. This just works.
I always have my Drupal root at the domain root. For example: http://www.example.com.
If I need to put the site in a subdirectory, I will always create a sub-domain. For example, if the Drupal directory is at: example.com/drupal, I will create a subdomain called drupal.example.com that transforms example.com/drupal into a domain root (drupal.example.com).
One of the reasons I do this is that I find root-relative links to be the most stable for links inside text areas. So links that I create inside nodes or custom blocks to other places on the same site I'll make them root-relative which is like, "/custompath" or "/longer/custompath".
Note however when you are in Drupal admin screens (as opposed to a node body or custom block) you don't put the forward slash at the beginning. Drupal itself doesn't have a hard time keeping track of where its root directory is and beginning with a forward slash will not work.
I've had trouble with truly relative links created inside nodes, such as a link like "custompath" or "node/1". Root-relative links take the guesswork out. But the downside of root-relative is that they always go to the domain root, even if the Drupal root is in a sub-directory. And so that is why I use the subdomain trick in those situations because the sub-domain essentially changes the location of the domain root.
This system makes moving the site to another server, another domain, or another directory on the same server, really, really simple.
Hope this makes some sense to you.
This isn't necessarily the "best" way, it's the way I've simplified things for myself so I don't have to be too much of a server geek and I get consistent results.
Shai
On Wed, Nov 18, 2009 at 7:41 PM, Néstor rotsen@gmail.com wrote:
I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
-- [ Drupal support list | http://lists.drupal.org/ ]
That sounds like a possible fix but I do not have control of the domain and subdomain names.
thanks,
Nestor :-)
On Wed, Nov 18, 2009 at 7:10 PM, Shai Gluskin shai@content2zero.com wrote:
I'm not sure I totally understand your question, but I'll tell you what works consistently for me with simplest possible set up on the server and no .htaccess or mod_rewrite complications. This just works.
I always have my Drupal root at the domain root. For example: http://www.example.com.
If I need to put the site in a subdirectory, I will always create a sub-domain. For example, if the Drupal directory is at: example.com/drupal, I will create a subdomain called drupal.example.com that transforms example.com/drupal into a domain root (drupal.example.com).
One of the reasons I do this is that I find root-relative links to be the most stable for links inside text areas. So links that I create inside nodes or custom blocks to other places on the same site I'll make them root-relative which is like, "/custompath" or "/longer/custompath".
Note however when you are in Drupal admin screens (as opposed to a node body or custom block) you don't put the forward slash at the beginning. Drupal itself doesn't have a hard time keeping track of where its root directory is and beginning with a forward slash will not work.
I've had trouble with truly relative links created inside nodes, such as a link like "custompath" or "node/1". Root-relative links take the guesswork out. But the downside of root-relative is that they always go to the domain root, even if the Drupal root is in a sub-directory. And so that is why I use the subdomain trick in those situations because the sub-domain essentially changes the location of the domain root.
This system makes moving the site to another server, another domain, or another directory on the same server, really, really simple.
Hope this makes some sense to you.
This isn't necessarily the "best" way, it's the way I've simplified things for myself so I don't have to be too much of a server geek and I get consistent results.
Shai
On Wed, Nov 18, 2009 at 7:41 PM, Néstor rotsen@gmail.com wrote:
I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
--
[ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Depending on where you're trying to use it, and if you can use PHP, you might try
<?php print base_path() ?>
Brian
On Thu, Nov 19, 2009 at 5:29 PM, Néstor rotsen@gmail.com wrote:
That sounds like a possible fix but I do not have control of the domain and subdomain names.
thanks,
Nestor :-)
On Wed, Nov 18, 2009 at 7:10 PM, Shai Gluskin shai@content2zero.comwrote:
I'm not sure I totally understand your question, but I'll tell you what works consistently for me with simplest possible set up on the server and no .htaccess or mod_rewrite complications. This just works.
I always have my Drupal root at the domain root. For example: http://www.example.com.
If I need to put the site in a subdirectory, I will always create a sub-domain. For example, if the Drupal directory is at: example.com/drupal, I will create a subdomain called drupal.example.comthat transforms example.com/drupal into a domain root (drupal.example.com).
One of the reasons I do this is that I find root-relative links to be the most stable for links inside text areas. So links that I create inside nodes or custom blocks to other places on the same site I'll make them root-relative which is like, "/custompath" or "/longer/custompath".
Note however when you are in Drupal admin screens (as opposed to a node body or custom block) you don't put the forward slash at the beginning. Drupal itself doesn't have a hard time keeping track of where its root directory is and beginning with a forward slash will not work.
I've had trouble with truly relative links created inside nodes, such as a link like "custompath" or "node/1". Root-relative links take the guesswork out. But the downside of root-relative is that they always go to the domain root, even if the Drupal root is in a sub-directory. And so that is why I use the subdomain trick in those situations because the sub-domain essentially changes the location of the domain root.
This system makes moving the site to another server, another domain, or another directory on the same server, really, really simple.
Hope this makes some sense to you.
This isn't necessarily the "best" way, it's the way I've simplified things for myself so I don't have to be too much of a server geek and I get consistent results.
Shai
On Wed, Nov 18, 2009 at 7:41 PM, Néstor rotsen@gmail.com wrote:
I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
--
[ Drupal support list | http://lists.drupal.org/ ]
--
[ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
I am not sure if this is exactly what you are looking for, but I find the Path Filter to be useful. You type in "internal:node/123" and it builds the right HREF link to that node.
http://drupal.org/project/pathfilter
Although I have not used it in a drupal move as you have described.
________________________________
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Néstor Sent: 19 November 2009 00:41 To: support@drupal.org Subject: [support] Path question
I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
****************************************************************************************************************************************************************
The content of this email (and any attachment) is confidential. It may also be legally privileged or otherwise protected from disclosure.
This email should not be used by anyone who is not an original intended recipient, nor may it be copied or disclosed to anyone who is not an original intended recipient.
If you have received this email by mistake please notify us by emailing the sender, and then delete the email and any copies from your system.
Liability cannot be accepted for statements made which are clearly the senders own and not made on behalf of Network Rail.
Network Rail Infrastructure Limited registered in England and Wales No. 2904587, registered office Kings Place, 90 York Way London N1 9AG
****************************************************************************************************************************************************************
WOW, I tried this and it messed up all of my files, lucky that I tried it first on a duplaicte site so my main site it still OK and I decided not to use the pathfilter. There is no documentation for it also, except for input from people having problems and possible solutions..
Thanks,
Nestor :-)
On Thu, Nov 19, 2009 at 4:00 AM, Clarke Robin < Robin.Clarke@networkrail.co.uk> wrote:
I am not sure if this is exactly what you are looking for, but I find the Path Filter to be useful. You type in "internal:node/123" and it builds the right HREF link to that node.
http://drupal.org/project/pathfilter
Although I have not used it in a drupal move as you have described.
*From:* support-bounces@drupal.org [mailto:support-bounces@drupal.org] *On Behalf Of *Néstor *Sent:* 19 November 2009 00:41 *To:* support@drupal.org *Subject:* [support] Path question
I have create a block that has some basic html links like <a href="/nestor/scroller612/as_dept/as_main">Admin Services</a>
This works but if I were to move my drupal site this will not work.
If I were to set the link as follows it will not work <a href="as_dept/as_main">Admin Services</a>
Now what is the proper way to point to a link ina drupal page?
How do you tell it to use the drupal site path + the location of the link you want to access?
Thanks,
Nestor :-)
The content of this email (and any attachment) is confidential. It may also be legally privileged or otherwise protected from disclosure.
This email should not be used by anyone who is not an original intended recipient, nor may it be copied or disclosed to anyone who is not an original intended recipient.
If you have received this email by mistake please notify us by emailing the sender, and then delete the email and any copies from your system.
Liability cannot be accepted for statements made which are clearly the senders own and not made on behalf of Network Rail.
Network Rail Infrastructure Limited registered in England and Wales No. 2904587, registered office Kings Place, 90 York Way London N1 9AG
-- [ Drupal support list | http://lists.drupal.org/ ]