How to automagically wrap any dtml-doc with std_header/footer
Hello! How do I go about to create the following situation: I want every dtml-method/document that is called from a browser to be wrapped with standard_html_header or standard_html_footer, even if there are no <dtml-var standard_html_...> tags in them. Just to clarify my question - I have a document "foo": --- <h1>Foo rules!</h1> <dtml-stuff expr="goes here" ...> <p>blah!</p> --- that does not include std_header/footer and when called by http://bar/foo it should be returned to the browser as if it had looked like this: --- <dtml-var standard_html_header> <h1>Foo rules!</h1> <dtml-stuff expr="goes here" ...> <p>blah!</p> </dtml-var standard_html_footer> --- ZPT/TAL or CMF answers need not apply, as they are (in our opinion, anyway) too un-mature at this point to be usable for our particular project. Any help appreciated. Sincerely, /dario - -------------------------------------------------------------------- Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services
it should be returned to the browser as if it had looked like this:
--- <dtml-var standard_html_header> <h1>Foo rules!</h1> <dtml-stuff expr="goes here" ...> <p>blah!</p> </dtml-var standard_html_footer> ---
ZPT/TAL or CMF answers need not apply, as they are (in our opinion, anyway) too un-mature at this point to be usable for our particular project.
Any help appreciated.
Make /foo a folder, put your content in a dtml doc called content within /foo : /foo/content and create a root index_html with : <dtml-var standard_html_header> <dtml-var content> </dtml-var standard_html_footer> Does it sounds ugly to anyone ? Philippe
From: "Philippe Jadin" <philippe@123piano.com>
Make /foo a folder, put your content in a dtml doc called content within /foo :
...snip...
Does it sounds ugly to anyone ?
Jepp, it sounds ugly :-). I've considered the solution you propose, but the reason we need this is to be able to let users create documents in a folder and have them adhere to the common look and feel of the site. Users might not always remember to put <dtml-var standard_html_header/footer> in their docs. I have another half-baked smi-solution where you use someting like http://bar/?foo and thus having the foo be an argument to the index_html method. This way I can check for foo's existence and do a getitem('foo', 1) on it to render it. The obvious drawback is the url; you have to remember to put that "?" in the url... So, I am looking for a better solution. Hoe does zope.org do it? /dario
So, I am looking for a better solution. Hoe does zope.org do it?
Dont use dtml-method/document's. Create a new custom python product/ZClass to store your data. I don't want to be rude, but if you don't know this, I don't see how you can say that ZPT is too un-mature at this point to be usable. /Magnus
----- Original Message ----- From: "Magnus Heino" <magnus.heino@pleon.sigma.se>
So, I am looking for a better solution. Hoe does zope.org do it?
Dont use dtml-method/document's. Create a new custom python product/ZClass to store your data.
Ok, I'll look into it.
I don't want to be rude, but if you don't know this, I don't see how you can say that ZPT is too un-mature at this point to be usable.
I am, as you yourself state, no expert, but I this is the reason not to choose ZPT for the moment: * I have the feeling that ZPT is still under more or less intense development. Now, I use stuff that is still under development in our project, exUserFolder for instance, but, in contrast to ZPT, I am able to grasp and understand the inner workings of exUserFolder and fix whatever error i discover myself. I cannot do that with ZPT, because it is a much larger and more complex piece of software. Also, _for our current project_, the effects of big changes are much more profound if we were to use ZPT compared to major changes in exUserFolder. I am having a hard time as it is keeping my co-developers happy with zope, which is a totally new environment for all of us. Adding the extra complexity of ZPT is really not an option at this moment. I am following the ZPT mailing list (more or less; I am subscribed), and we will be switching to ZPT in future projects, not because it will be bundled with future Zope versions, but for the very reason that I chose Zope over PHP, JSP, Perl in the first place: separation of content, presentation and logic. So, this is the reason I have for not choosing ZPT over dtml *right now*. Maybe it is the wrong one, but so be it; we are two weeks from user testing, this issue is a minor thing and I am not about to do ZPT evangilising at this stage. And yes, imo, you were rude; that last comment was totally uncalled for.
/Magnus
Sincerely, /dario - -------------------------------------------------------------------- Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services
Dont use dtml-method/document's. Create a new custom python product/ZClass to store your data.
Are you sure it's mandatory to have a custom product to store your content? For example, if you create a file by ftp, it is automatically added as a dtml-doc. Is it a bad thing to use dtml-docs in folders for the content ? Philippe
On Fri, Oct 26, 2001 at 01:01:04PM +0200, Philippe Jadin wrote:
Are you sure it's mandatory to have a custom product to store your content? For example, if you create a file by ftp, it is automatically added as a dtml-doc. Is it a bad thing to use dtml-docs in folders for the content ?
In his particular case, where his content people couldn't be expected to remember dtml stuff, he would need a custom product. However, answers to both your questions can be found at: http://www.zope.org/Members/sf/HTMLDocument (good for ZMI users) or http://www.zope.org/Members/unfo/howto_wrapper (good for FTP users) -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
On Fri, Oct 26, 2001 at 09:45:56AM +0200, Dario Lopez-Kästen wrote:
I have another half-baked smi-solution where you use someting like
and thus having the foo be an argument to the index_html method. This way I can check for foo's existence and do a getitem('foo', 1) on it to render it.
The obvious drawback is the url; you have to remember to put that "?" in the url...
So, I am looking for a better solution. Hoe does zope.org do it?
I have a folder where I do almost the same thing. Access to /folder/something is rewritten by the apache frontend to /folder/?id=something. Then the clients can access all id's as if they were files. Apache rewrite rule to achieve this: RewriteEngine On RewriteRule ^/folder/([A-Z].*) http://localhost:8080/folder/?id=$1 [L,P] This method only applies to names starting with capital letters. -jf
participants (5)
-
Dario Lopez-Kästen -
Jan-Frode Myklebust -
Magnus Heino -
Mike Renfro -
Philippe Jadin