Does anyone know how to link to a file on a local hard drive from the menu. It can be done on nodes, and on custom blocks, but for some reason it seems to be impossible to do this from the menu. My users will not be allowed to create custom blocks, so I need a way for them to add their content (sometimes - links to local files) to the menu.
Please help. This is seriously limiting the functionality of our site.
Brian
Comments
Comment #1
wings commentedI'm using Drupal 4.6.6, with PHP 4.4.2, on Apache 2.2 under Red Hat Linux 9
Comment #2
Steven commentedUse absolute URLs.
Comment #3
wings commentedIs there a setting somewhere for absolute URLs that I can change? I've obviously been typing the absolute URL in but that's getting me nowhere.
Comment #4
RobRoy commentedIIRC, Drupal 4.6 doesn't allow absolute URLs in menu items, that came in 4.7. I would recommend upgrading.
Comment #5
wings commentedI have upgraded to Drupal 4.7.4. I still can't get the link to work - it still appends file://etc on to the end of www.mysite.com/drupal/?u=. Is there somewhere I can set it to use absolute urls?
Comment #6
RobRoy commentedOh, you're linking to files on the user local computer? I am not sure why you would ever want to do that.
Comment #7
wings commentedWe are using Drupal for our intranet site, and we want staff to be able to get at certain local files easily.
Comment #8
RobRoy commentedOkay, the easiest way to do this in 4.7 is to install devel module then execute this PHP code. This is just off the top of my head, but should allow 'file://' URLs now.
variable_set('filter_allowed_protocols', array('http', 'https', 'file', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal');
Comment #9
wings commentedI'm getting the following error when I try and run that PHP
Parse error: syntax error, unexpected ';' in /var/www/html/drupal47/modules/devel/devel.module(454) : eval()'d code on line 1
Sorry - my PHP is so poor I'm not able to figure out what's wrong with it. Removing the ; just gives an unexpected $end error:
Parse error: syntax error, unexpected $end in /var/www/html/drupal47/modules/devel/devel.module(454) : eval()'d code on line 2
Comment #10
wings commentedPerfect! There was just a bracket missing from the PHP, once I spotted that it worked perfectly.
Many thanks
Brian
Comment #11
RobRoy commentedI had left out an extra parenthesis on the end. Try this:
variable_set('filter_allowed_protocols', array('http', 'https', 'file', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal'));
Comment #12
(not verified) commented