To Redirect or not to Redirect, that is the question
Uh... how would I put it. I've hit another brickwall :) (I'm ashamed to come to this only to ask for help....) I have problem with rendering images in a sub-sub-sub-folder that are linked with <img src> tags inside a html-document within that same sub-sub-sub-folder. For example: main_index.html 1999 10 1000 1001 1002 (i.e. unique article) index.html (render article visible method) image1 (image within the article) image2 image3 In the above scenario I have an article that can be viewed by calling index.html. This can be done with an easy URL that point to the right index.html and the images within that article folder object are rendered beautifully. However, if I want to call only ONE property of EACH article from within main_index.html (that is at root level), I run into problems if the property I want to display (such as teaser) contains a reference to an image within that article. So, if I from main_index.html do the following: <dtml-with "_[_.str(year)]"> <dtml-with "_[_.str(month)]"> <dtml-in "objectValues('KMArticle')" sort=release reverse> <dtml-var teaser> </dtml-in> </dtml-with> </dtml-with> The teaser property for each article is displayed just as I want it to be, but all the image references point to: http://www.mydomain.com/imagename whereas they should point to: http://www.mydomain.com/year/month/articleid/imagename ...in order to be rendered correctly. This is due to the browser still working within the context of main_index.html (that is inside the root folder) and not inside the article folder the property of which I'm about to render. So, my question is: how do I display a property of an object from within a sub-sub-sub-folder while also displaying all inline elements from within that sub-sub-sub-folder to which the property refers to (by use of relative <img src> , <embed> and such html tags)? I know I can do a redirect response, but then it totally jumps to another page (out of my dtml-with recursion) and I can't have that. I need to stay within my loop and also display the images properly for each article. I don't know how to do this. Help :) Best regards, Samu Mielonen PS KMMN is shaping up nicely. I have send an article submittal form, preview an article, send an article for submittal, approve submitted article and publish submitted article (except for the images) working nicely. I'll publish my dtml to anybody interested as soon as I get things wrapped up. -- "The world will not evolve past its current state of crisis by using the same thinking that created the situation." - Albert Einstein
Samu Mielonen wrote:
Uh... how would I put it. I've hit another brickwall :) (I'm ashamed to come to this only to ask for help....)
I have problem with rendering images in a sub-sub-sub-folder that are linked with <img src> tags inside a html-document within that same sub-sub-sub-folder.
[...]
http://www.mydomain.com/imagename
whereas they should point to:
http://www.mydomain.com/year/month/articleid/imagename
...in order to be rendered correctly.
have you tried using <IMG SRC="<dtml-var "imagename.absolute_url()">">? This might break if there are imagenames in the root directory. -- mindlace Disclaimer: Any use of this email, in any manner whatsoever, will increase the amount of disorder in the universe. Although no liability is implied herein, the reader is warned that this process will ultimately lead to the heat death of the universe.
participants (2)
-
Ethan Fremen -
Samu Mielonen