roller-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Levy <David.L...@Sun.COM>
Subject Re: How do I include *.txt file contents in a Roller Page
Date Thu, 20 Mar 2008 10:22:52 GMT

I am unsure of what you're looking to do, but I hope the following helps.

I have customised the currency theme and moved towards having a bunch of 
includes. I usually put the file in to the templates directory and use 
the preceding underbar convention e.g. _banner

The following code then includes it into the weblog file

    #includeTemplate($model.weblog "_banner")

In my case _banner contains html code and is an ascii file (I think)

For this to work on each article, my theme came with an _day file within 
which is a loop

     #foreach( $entry in $entries )

the enclosed code is executed for each article

I place the code to display the affinity/posting buttons after each 
article in this loop. See shows  
example code for this usage.

You can include your text file within this loop. may also have some hints.

richiebaby wrote:
> Hi,
> Using Roller V4
> I am looking for a way to include a page within all my weblogs where the
> body text contents can change for each blog but the holding page is the
> same, much like an About this blog page.
> So far I have created a new Roller template called about and within the
> about template I would like to include the contents of a .txt file that
> currently resides in the file uploads (if anybody else knows of a better
> method for my requirement then please let me know).
> From looking at this forum and reading the Roller manual and velocity user
> guide, it does look like this is not default Roller functionality. However,
> I wanted to ask in case I have missed a simple solution. 
> I tried using the #include method found in the velocity user guide:
> but this causes my page to break, I noticed in the user guide it mentions
> TEMPLATE_ROOT, could somebody please explain this?



*David Levy *
*Chief Technologist*
Europe, Middle East & Africa
Global Sales & Services
Sun Microsystems Ltd.
55, King William St.,
London EC4R 9ND United Kingdom

Phone +44 (0) 20 7469 9908/x18308
Mobile +44 (0) 7710-360922
Email David.Levy@Sun.COM

Sun Proprietary & Confidential . This e-mail message is for the sole use 
of the intended recipient(s) and may contain confidential and privileged 
information. Any unauthorised review, use, disclosure or distribution is 
prohibited. If you are not the intended recipient,, please contact the 
sender by reply e-mail and destroy all copies of the original message.

View raw message