Re. Question on Folder Structure strategy
Just to second Evan's motion, "site relative" links will make it much easier to move the Zope pieces you're building to another Zope instance, if and when the time comes. It's pretty painless to simply "Export" a subfolder, and then "Import" into another Zope, knowing that everything will still work, even though the DNS address, and name (alias), of the host has changed. This is quite common in a corporate environment with separate dedicated host machines, e.g., development, testing, and production. In this case only the latter would be a live Web server with real end users hitting Zope "pages", as opposed to us synthetic developer, and tester types. If you use absolute paths, you'll either have to go through all those hard coded addresses, and change them, which is nothing but completely avoidable drudgery, when you use the "site relative" approach. Sure, you could keep your systems on separate LANs that can't "see" each other, or do some fancy DNS manipulations and redirections so you can have duplicate names on different host machines. This latter notion isn't all that uncommon, Network Address Translation (NAT) has lot's of appropriate uses, but in this case it would just make your life unneccesarily more complicated than it needs to be. I've moved data from my desktop Zope (Win '95), to a testing host (NT), and finally to Sun Solaris, without having to change anything! Don't ask why we're not using Linux, it makes me very grumpy . . . Later, Jerry S.
+----[ Jerry Spicklemire ]--------------------------------------------- | Just to second Evan's motion, "site relative" links will make it much | easier to move the Zope pieces you're building to another Zope instance, if | and when the time comes. It's pretty painless to simply "Export" a | subfolder, and then "Import" into another Zope, knowing that everything | will still work, even though the DNS address, and name (alias), of the host | has changed. Why not set a top level property that has the http://hostname/basefolder location in it. All your URLS would become <a href="<dtml-var BASELOCATION>/relativefolder">Blah</a> Move locations, change the property -- everything works. If you don't set it everything becomes relative to the root. -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
Hi again, Especially if you suspect that the nesting of your folders may change, this is is an excellent solution, and not necessarily either / or, as your example illustrates. Your example also shows that you do have to deal with calling the property as a <dtml-var> at every anchor, which you can just skip when you have a stable site that let's you adopt a "site relative" convention. I don't have a clue as to the "cost" of each little <dtml-var>, in terms of performance, and overall load on Zope, but I always figure no load at all is best, whenever you can swing it! Later, Jerry S. At 12:46 PM 1/31/00 +1000, you wrote:
+----[ Jerry Spicklemire ]--------------------------------------------- | Just to second Evan's motion, "site relative" links will make it much | easier to move the Zope pieces you're building to another Zope instance, if | and when the time comes. It's pretty painless to simply "Export" a | subfolder, and then "Import" into another Zope, knowing that everything | will still work, even though the DNS address, and name (alias), of the host | has changed.
Why not set a top level property that has the http://hostname/basefolder location in it.
All your URLS would become
<a href="<dtml-var BASELOCATION>/relativefolder">Blah</a>
Move locations, change the property -- everything works.
If you don't set it everything becomes relative to the root.
-- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
Andrew Kenneth Milton wrote:
Why not set a top level property that has the http://hostname/basefolder location in it.
All your URLS would become
<a href="<dtml-var BASELOCATION>/relativefolder">Blah</a>
Alternatively, you can use the built-in &dtml-BASE1;, &dtml-BASE2;, or whatever works for your arrangement instead of an explicitly managed BASELOCATION. Cheers, Evan @ 4-am (and soon digicool)
Evan Simpson wrote:
Andrew Kenneth Milton wrote:
Why not set a top level property that has the http://hostname/basefolder location in it.
All your URLS would become
<a href="<dtml-var BASELOCATION>/relativefolder">Blah</a>
Alternatively, you can use the built-in &dtml-BASE1;, &dtml-BASE2;, or whatever works for your arrangement instead of an explicitly managed BASELOCATION.
I have used this approach. It was particularly useful for a site that needed to be visible as two separate URLs. ie: <a href="&dtml-BASE1;/relativefolder">Blah</a> would get rendered as <a href="http://www.somesite.com/relativefolder">Blah</a> or <a href="http://www.someothersite.com/relativefolder">Blah</a> depending on which URL had been accessed. HTH, Michael Bernstein.
participants (4)
-
Andrew Kenneth Milton -
Evan Simpson -
Jerry Spicklemire -
Michael Bernstein