[support] theming primary links, or absolute paths when drupal is in a sub-directory

Cog Rusty cog.rusty at gmail.com
Wed Oct 31 14:02:58 UTC 2007


On 10/31/07, Amanda B Hickman <amanda at velociraptor.info> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thanks for taking a stab at it. Here are some responses that I hope will
> clarify my troubles a wee bit ...
>
> Cog Rusty wrote:
> > Generally, if you access your Drupal site as
> > http://www.example.com/drupal/ then that's your site's web root.
>
> Right, that is my drupal site's root.
>
> > If you use a fully qualified URL in a menu to take you to
> > http://www.example.com/news that will take you outside Drupal, unless
> > you have set up a Drupal site for http://www.example.com.
>
> Right: a fully qualified URL will do that, but I'd have to include the
> domain name (http://www.example.com). The site is moving around,
> however, and the domain name could be any of ...
>
> http://www.example.com
> http://staging.example.com
> http://example.local
>
> And I want to be able to test out the menus and other changes on a
> staging site before I push the drupal section live.


I still don't understand. You want that menu link to change, based on
what? If you are in a http://www.example.com/drupal site, how could
the menu link switch to any other domain? Based on what?

If you manage to use an apache rewrite, what condition is that going
to check for changing domain?

I don't see any other way except depending on the domain of the Drupal
site that you are currently in.


> > I am not sure I completely understand what you are trying to achieve
> > and what you are running in your http://www.example.com site, but the
>
> The rest of the site uses a frightening home-brewed content management
> system developed over many years by many programmers. I'm in the process
> of streamlining that, but first I'd like to get a few things into drupal
> and working well (our forums, for one thing).
>
> > usual method of using multiple domain names is to point all domain
> > names to Drupal's installation directory and set up respective
> > settings.php files for the different domains to use the same database
> > ($db_url).
>
> Drupal works fine under each of these domain names, and the separate
> settings.php files in sites/example.local and sites/staging.example.com
> do a fine job of pointing it off to different databases depending on
> where I'm accessing it from. That part works fine.
>
>
> > Consider
> > - setting up Drupal sites for all the domains or subdomains you want
> > (see http://drupal.org/node/147828),
> > - don't set up a Drupal site for http://www.example.com/drupal/,
> > - and use your .htaccess file to make Drupal leave alone certain paths
> > of your other application (http://drupal.org/node/30334).
> >
> > There was a discussion about using some .htaccess tricks
> > (http://drupal.org/node/144643) but I wouldn't go there before trying
> > all the standard methods. This kind of .htaccess tricks tend to make a
> > setup fragile.
>
> I'm not dying to go the .htaccess route, I promise, but I can't figure
> out how to persuade drupal that a path in the menu like "/news/" is
> relative to the whole site, not relative to drupal.
>
>
> >
> > On 10/30/07, Amanda Bee <amanda at velociraptor.info> wrote:
> > I'm still working on this, though I suspect from my reading that the
> > real solution lies in .htaccess rewrite rules.
> >
> > I thought this:
> >
> > RewriteRule ^/drupal//(.*) /$1 [L]
> >
> > Would work -- take paths that have the double slash and bump them up a
> > level to the root of the site -- but it doesn't seem to be taking. For
> > bonus fun I tried quirky variations like ...
> >
> > RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
> >
> > And didn't get anywhere either. Am I even making sense here?
> >
> > Thanks,
> > amanda
> >
> > (http://drupal.org/node/187647)
> >
> >
> > Amanda B Hickman wrote:
> >>>> I'm puzzling through a few things at once and starting to hit walls on
> >>>> this one as well.
> >>>>
> >>>> I've got drupal set up in a subdirectory of a larger site. That larger
> >>>> site is in subversion and I run a staging site and a few local
> >>>> incarnations of it, which means that the site's domain name changes
> >>>> periodically, from "staging.example.com" to "example.local" or
> >>>> "www.example.com"
> >>>>
> >>>> Right now, I've got the site's overall primary links in drupal as
> >>>> primary links, and I'd like to keep them there, but drupal is gobbling
> >>>> up the absolute paths even though they're absolute:
> >>>>
> >>>> I gave the menu path as
> >>>>
> >>>> "/news/" and drupal points to
> >>>>
> >>>> "http://staging.example.com/drupal//news/"  when I'm aiming for
> >>>>
> >>>> "http://staging.example.com/news"
> >>>>
> >>>> I spent a lot of time monkeying with clean URLs on the theory that
> >>>> they'd fix this, only to discover ... nope.
> >>>>
> >>>> I've looked around for a themeable function that would let me wrestle
> >>>> links into being relative to the site as a whole, not relative to
> >>>> drupal, but I'm not seeing it.
> >>>>
> >>>> This doesn't appear to be controlled by "theme_menu_links"
> >>>> http://api.drupal.org/api/function/theme_menu_links/5
> >>>>
> >>>> Any suggestions?
> >>>>
> >>>> Thanks,
> >>>> Amanda
> >>>>
> >>>>
> >
> >
> - --
> [ Drupal support list | http://lists.drupal.org/ ]
> >>
>
>
> - --
> Amanda B Hickman
> (p) 917 655 2579
> (s) amandabee
> (a) amandahlinc
> (w) http://velociraptor.info
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHJ6nmrxDTsWdh5zkRAvrqAJ4ytwZ1agEWPwMBvXE9Dai6UJlIQgCaA+ZA
> /aGt3qtn1ycR4megS5I9FQc=
> =A3hC
> -----END PGP SIGNATURE-----
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list