I am confused about acquisition. What I want to do is I have a home page, and I have a standard_html_header I am including in it. standard_html_header changes the background color to say, black. These are both in a folder. I want to create a subfolder of this folder and only replace standard_html_header to change the background color to white. Kinda like theming, I want to keep all the content and keep the root black site, but then have a second identical copy that is all white. What I find when I try to do this, is I copy standard_html_header into my subfolder, and I make my change there. I have no index_html in my subfolder. I am assuming it will work like inheritance in OOP and inherit anything that's not there, and have it then refer to the current folder for it's standard html header. What actually happens though, is when I reference this folder, it goes to the parent, gets the index_html AND the standard_html_header from the parent and uses it to override my standard_html_header in my child folder! What am I doing wrong? -- The sooner you make your first 5000 mistakes, the sooner you will be able to correct them. -- Nicolaides
On Wed, 12 Apr 2000 jiva@devware.com wrote:
the index_html AND the standard_html_header from the parent and uses it to override my standard_html_header in my child folder!
What am I doing wrong?
Although you can accomplish what you need using the method you descripe above, IMO a better and easier design is not to copy the standard_html_header in the subdirectory but just use a property to define the background. For instance, in standard_html_header one can have something like: BGCOLOR="<dtml-var bgcolor>" ... and then define a property bgcolor on your folder/subfolder hierarchy as required. The top folder can have the property bgcolor=black and any such. Note that subfolders that do not define bgcolor will acquire the background from the top folder. In this way if you decide later to make changes to standard_html_header you will be required to modify it at only one place. ... and make sure standard_html_header is a DTMLMethod not Document. Pavlos
On Thu, 13 Apr 2000, Daryl Tester wrote:
Pavlos Christoforou wrote:
... and make sure standard_html_header is a DTMLMethod not Document.
OK, this isn't immediately obvious to me. Why?
Hi Daryl - DTML Methods and ExternalMethods (I suppose PythonMethods too) are special in that they 'attach' to the object that calls them. (At least this is how I understand it because even though they don't add their own namespace in the stack, they still don't obey regular acquisition rules. If I am wrong I hope someone can correct me). Generally I find that in most situations having standard_html_header/footer and index_html as DTMlMethods is more appropriate. Pavlos
participants (3)
-
Daryl Tester -
jiva@devware.com -
Pavlos Christoforou