22847 Posts in 9642 Topics by 2802 members
|Go to End|
16 May 2012 at 10:16pm Last edited: 17 May 2012 11:01pm
As I'm incorporating SS into an existing large site I need to link to local static pages on the same server/domain.
I didn't envisage any probs until I tried to setup the links as redirect pages, when I discovered that the redirect page form wrongly but automatically adds 'http://' to local links, rendering them broken.
But, if I use FQDN links this will make it impossible to test the site before uploading. Plus, it is bad website practice to do so.
The webpage editor has the same problem too, making it impossible to link to any local file. I can hack-around this one by entering HTML directly, but no such workaround exists for menu redirector pages
Is there any way of resolving this, other than hacking the cms code?
v2.4.7 on xampp test site.
Since no comments, I Might add that this seems to be a classic example of 'duck programming' -Exactly what the coders say a cms shouldn't contain. Namely, creating a system with 'ease of use' features which straitjacket the user into nonstandard ways of working. It's also painfully evident that this feature wasn't tested properly, or the negative consequences would have been spotted.
Mind you it is by no means the only example. Perhaps the most serious is that standard php code cannot be used in templates.
OK, flame me if you wish, but I think it is unwise to soapbox about duck code when features like this abound.
20 May 2012 at 12:11pm
It's likely that testing pointing to a local html file on the same domain has not be a use case thats come up (most people have all their content in SilverStripe or the 2 separate).
The code that adds the http is in Redirector page (https://github.com/silverstripe/silverstripe-cms/blob/master/code/model/RedirectorPage.php#L111). So it makes it quite clear that relative file paths were never thought of.
I recommend submitting a patch to add a new type called 'Relative' perhaps (https://github.com/silverstripe/silverstripe-cms/blob/master/code/model/RedirectorPage.php#L14). You would just need to update a couple functions to say if Relative or External return the URL Field (i.e https://github.com/silverstripe/silverstripe-cms/blob/master/code/model/RedirectorPage.php#L68)
|Go to Top|