including other objects from other folders
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maybe this is in a faq somewhere (if so please point me to it!) but all the ones i've seen don't describe any way to do this: I want to include dhtml using a <#var > statement. That's easy... but I want to include it from a different folder than the one i'm currently in. For example... In index_html in my Squishdot folder, I want to "include" a "Poll" module in the page. Here's the hierarchy... + root - index_html + Squishdot - index_html + Poll - index_html So in my root/Squishdot/index_html, I want a statement like <#var Poll/index_html> but this of course gives a server error... it apparently doesn't understand the / I gave it. Is there some other #include statement that I should be using? Or is there some trick to using #var? The documentation is so random, I can't find such a basic description of how to do what I need! (plus Im really new to zope, so that may have something to do with it) Please email me a reply at KevinMeinert@BigFoot.com Thanks!! Kevin -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com> iQA/AwUBOLaiWDlszdAdzf4MEQIXewCg64IUIWgqm1fgshedEKNLQQ3gXS0AoPqF eY8rl8eAcsEBK1l2tM9AR706 =iwBA -----END PGP SIGNATURE-----
Try: <!--#var Poll--> or <dtml-var Poll> <#var ...> is not valid syntax Zope should render the index_html document in Poll by default ----- Original Message ----- From: Kevin Meinert <kevn@vrac.iastate.edu> To: <zope@zope.org> Sent: Friday, February 25, 2000 9:40 AM Subject: [Zope] including other objects from other folders -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maybe this is in a faq somewhere (if so please point me to it!) but all the ones i've seen don't describe any way to do this: I want to include dhtml using a <#var > statement. That's easy... but I want to include it from a different folder than the one i'm currently in. For example... In index_html in my Squishdot folder, I want to "include" a "Poll" module in the page. Here's the hierarchy... + root - index_html + Squishdot - index_html + Poll - index_html So in my root/Squishdot/index_html, I want a statement like <#var Poll/index_html> but this of course gives a server error... it apparently doesn't understand the / I gave it. Is there some other #include statement that I should be using? Or is there some trick to using #var? The documentation is so random, I can't find such a basic description of how to do what I need! (plus Im really new to zope, so that may have something to do with it) Please email me a reply at KevinMeinert@BigFoot.com Thanks!! Kevin -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com> iQA/AwUBOLaiWDlszdAdzf4MEQIXewCg64IUIWgqm1fgshedEKNLQQ3gXS0AoPqF eY8rl8eAcsEBK1l2tM9AR706 =iwBA -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, but what about if root/index_html includes Squishdot? I tried this, and I get Squishdot folder properties on the screen instead of the actual index_html. Also, what about the case in which I'd want to include Poll/somefolder/index_html? (I did mean <!-- #var ... --> before, sorry typo!) Thanks! Kevin - -----Original Message----- From: Jim Sanford [mailto:jsanford@atinucleus.com] Sent: Friday, February 25, 2000 9:51 AM To: kevn@vrac.iastate.edu; zope@zope.org Subject: Re: [Zope] including other objects from other folders Try: <!--#var Poll--> or <dtml-var Poll> <#var ...> is not valid syntax Zope should render the index_html document in Poll by default - ----- Original Message ----- From: Kevin Meinert <kevn@vrac.iastate.edu> To: <zope@zope.org> Sent: Friday, February 25, 2000 9:40 AM Subject: [Zope] including other objects from other folders *** PGP Signature Status: good *** Signer: Kevin August Meinert <KevinMeinert@bigfoot.com> *** Signed: 2/25/00 9:40:08 AM *** Verified: 2/25/00 9:54:22 AM *** BEGIN PGP VERIFIED MESSAGE *** Maybe this is in a faq somewhere (if so please point me to it!) but all the ones i've seen don't describe any way to do this: I want to include dhtml using a <#var > statement. That's easy... but I want to include it from a different folder than the one i'm currently in. For example... In index_html in my Squishdot folder, I want to "include" a "Poll" module in the page. Here's the hierarchy... + root - index_html + Squishdot - index_html + Poll - index_html So in my root/Squishdot/index_html, I want a statement like <#var Poll/index_html> but this of course gives a server error... it apparently doesn't understand the / I gave it. Is there some other #include statement that I should be using? Or is there some trick to using #var? The documentation is so random, I can't find such a basic description of how to do what I need! (plus Im really new to zope, so that may have something to do with it) Please email me a reply at KevinMeinert@BigFoot.com Thanks!! Kevin *** END PGP VERIFIED MESSAGE *** _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com> iQA/AwUBOLamnTlszdAdzf4MEQLKAACeJ+WsD8la6X3a/KN/D/EnkFJwXcgAoLBY FEW9kceFTk0+8YKRJ4y9TqrC =OHPs -----END PGP SIGNATURE-----
<dtml-with Squishdot> <dtml-with Poll> <dtml-var index_html_or_whatever> </dtml-with> </dtml-with> If you're really including index_html, watch out for recursive calls to standard_html_header. -- Loren ----- Original Message ----- From: Kevin Meinert <kevn@vrac.iastate.edu> To: <zope@zope.org> Sent: February 25, 2000 07:40 AM Subject: [Zope] including other objects from other folders
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Maybe this is in a faq somewhere (if so please point me to it!) but all the ones i've seen don't describe any way to do this:
I want to include dhtml using a <#var > statement. That's easy... but I want to include it from a different folder than the one i'm currently in. For example...
In index_html in my Squishdot folder, I want to "include" a "Poll" module in the page.
Here's the hierarchy... + root - index_html + Squishdot - index_html + Poll - index_html
So in my root/Squishdot/index_html, I want a statement like <#var Poll/index_html> but this of course gives a server error... it apparently doesn't understand the / I gave it.
Is there some other #include statement that I should be using? Or is there some trick to using #var? The documentation is so random, I can't find such a basic description of how to do what I need! (plus Im really new to zope, so that may have something to do with it)
Please email me a reply at KevinMeinert@BigFoot.com
Thanks!! Kevin
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>
iQA/AwUBOLaiWDlszdAdzf4MEQIXewCg64IUIWgqm1fgshedEKNLQQ3gXS0AoPqF eY8rl8eAcsEBK1l2tM9AR706 =iwBA -----END PGP SIGNATURE-----
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 That works, thanks. Now another question. - ----------------------- When I click the "Vote" button on that page it can't find the link, because the links are now relative to the parent directory instead of to the "poll" directory. Is there a way to change the current directory so that anything you include will have it's links resolve correctly? I would think that <dtml-with> would do this, but it doesn't seem to. Im thinking the code should look like this, but don't know the right commands. The dtml-change dir would be the one I don't know.. It pushes and pops the current folder state (or context): <dtml-changedir poll> <dtml-with poll> # this may be redundant... <dtml-var index_html> </dtml-with> # this may be redundant also... </dtml-changedir> (I know I *could* just go change the <a href>s in poll/index_html, but what if some other directory were to include it... i want general purpose! ) Write me at kevn@vrac.iastate.edu Thanks for helping this newbie. Kevin - -----Original Message----- From: Loren Stafford [mailto:lstaffor@dynalogic.com] Sent: Friday, February 25, 2000 9:55 AM To: kevn@vrac.iastate.edu; zope@zope.org Subject: Re: [Zope] including other objects from other folders <dtml-with Squishdot> <dtml-with Poll> <dtml-var index_html_or_whatever> </dtml-with> </dtml-with> If you're really including index_html, watch out for recursive calls to standard_html_header. - -- Loren - ----- Original Message ----- From: Kevin Meinert <kevn@vrac.iastate.edu> To: <zope@zope.org> Sent: February 25, 2000 07:40 AM Subject: [Zope] including other objects from other folders
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Maybe this is in a faq somewhere (if so please point me to it!) but all the ones i've seen don't describe any way to do this:
I want to include dhtml using a <#var > statement. That's easy... but I want to include it from a different folder than the one i'm currently in. For example...
In index_html in my Squishdot folder, I want to "include" a "Poll" module in the page.
Here's the hierarchy... + root - index_html + Squishdot - index_html + Poll - index_html
So in my root/Squishdot/index_html, I want a statement like <#var Poll/index_html> but this of course gives a server error... it apparently doesn't understand the / I gave it.
Is there some other #include statement that I should be using? Or is there some trick to using #var? The documentation is so random, I can't find such a basic description of how to do what I need! (plus Im really new to zope, so that may have something to do with it)
Please email me a reply at KevinMeinert@BigFoot.com
Thanks!! Kevin
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>
iQA/AwUBOLaiWDlszdAdzf4MEQIXewCg64IUIWgqm1fgshedEKNLQQ3gXS0AoPqF eY8rl8eAcsEBK1l2tM9AR706 =iwBA -----END PGP SIGNATURE-----
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com> iQA/AwUBOLa8NTlszdAdzf4MEQKv/QCg8fPqZxXD+UsMtQvv3PQSx6jmJmIAn3+w na0dZaQj3AQDZIG7blYfHOET =QRIo -----END PGP SIGNATURE-----
I don't really have a clear picture of your requirements, but if you are building HREFs with dtml-var, look into the differences between <dtml-var url> and <dtml-var absolute_url> The latter has gotten me out of trouble many times. There's no concept of "current directory" in Zope. In fact, there's no concept of directory. When thinking of a "folder", think "object". When building URLs, think "How can I make a URL that will map to my object?". -- Loren ----- Original Message ----- From: Kevin Meinert <kevn@vrac.iastate.edu> To: <zope@zope.org> Sent: February 25, 2000 09:30 AM Subject: [Zope] Is directory context switching possible?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
That works, thanks. Now another question. - ----------------------- When I click the "Vote" button on that page it can't find the link, because the links are now relative to the parent directory instead of to the "poll" directory.
Is there a way to change the current directory so that anything you include will have it's links resolve correctly? I would think that <dtml-with> would do this, but it doesn't seem to.
Im thinking the code should look like this, but don't know the right commands. The dtml-change dir would be the one I don't know.. It pushes and pops the current folder state (or context):
<dtml-changedir poll> <dtml-with poll> # this may be redundant... <dtml-var index_html> </dtml-with> # this may be redundant also... </dtml-changedir>
(I know I *could* just go change the <a href>s in poll/index_html, but what if some other directory were to include it... i want general purpose! )
participants (3)
-
Jim Sanford -
Kevin Meinert -
Loren Stafford