I've got a folder which contains DTMLMethods which are used to format a "news" article in a certain way. One of the methods is responsible for actually displaying the article contents, the others are responsible for generating various navigational components. I'm now designing a new view which is also going to display a news article, plus some other stuff. The major difference is that this view is only going to show a subset of information. I would like to reuse the article display code but I'm not exactly sure how to do it. What I would like to do is retrieve the first N characters from a news article and then have my method format it. Something like: <dtml-var "formattingMethod(???, <dtml-var articleContent size=500>)"> I'm not fluent enough in all the nuances of how you call a DTMLMethod rather than get results via reference/acquisition. I suppose I could pass the length restriction as a parameter and if that parameter didn't exist the full article would be retrieved. I would rather simply pass the article contents and let the method format what it is given. Any help would be appreciated. Thanks. James W. Howe mailto:jwh@allencreek.com Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
How About: <dtml-var "idOfTheDocument.raw[:sizeOfSlice]"> or maybe: <dtml-var "idOfTheDocument(_.None, _)[:sizeOfSlice]"> depending on what you want.... -steve
"James" == James W Howe <jwh@allencreek.com> writes:
James> I've got a folder which contains DTMLMethods which are used James> to format a "news" article in a certain way. One of the James> methods is responsible for actually displaying the article James> contents, the others are responsible for generating various James> navigational components. I'm now designing a new view James> which is also going to display a news article, plus some James> other stuff. The major difference is that this view is James> only going to show a subset of information. I would like James> to reuse the article display code but I'm not exactly sure James> how to do it. What I would like to do is retrieve the James> first N characters from a news article and then have my James> method format it. Something like: James> <dtml-var "formattingMethod(???, <dtml-var articleContent James> size=500>)"> James> I'm not fluent enough in all the nuances of how you call a James> DTMLMethod rather than get results via James> reference/acquisition. I suppose I could pass the length James> restriction as a parameter and if that parameter didn't James> exist the full article would be retrieved. I would rather James> simply pass the article contents and let the method format James> what it is given. James> Any help would be appreciated. James> Thanks.
participants (2)
-
James W. Howe -
Steve Spicklemire