I've had some success incorporating printbox with Campsite. At the
moment it works with Fastnews by translating /look/fastnews/article.tpl
into /look/fastnews/article-print.tpl, then concatenating the output
from the various articles. It prepares the articles for printing by
making virtual requests to Apache - this needs to be changes to local
requests to the parser executable.
But for the moment I need some advice about documents with subheads /
subsections. What is the meaning of the additional URL parameters
that are added for a 'single page view', and how do these translate to
the 'short urls' format?
I've only got printbox working with the 'template path' URLs at this
stage, because with short URLs it is harder to specify the template
because it needs an ID rather than a path.
Mugur, can you give me some comments on the 'single page' urls please?
I assume that if someone wants to print out an article, we want them to
print out the whole article, rather than just a subsection?
If my computer is turned on, you can see it in action at campsite dot
jdpipe dot dyndns.org
Cheers
JP
------------------------------------------
Posted to Phorum via PhorumMail
--- John Pye wrote:
> But for the moment I need some advice about documents with subheads /
> subsections. What is the meaning of the additional URL parameters
>
> &ST1=text&ST_T1=extended&ST_PS1=1&ST_AS1=1&ST_LS1=0&ST_max=1
ST1 - field name (in this case the field name is 'text')
ST_T1 - article type (in this case article type is 'extended')
ST_PS1 - start subtitle from which to display article, that means ignore
previous subtitles (in this case '1' - display starting from first subtitle)
ST_LS1 - subtitle list start (used when displaying a list of article subtitles)
ST_AS1 - whether to display the whole article (all subtitles) or just the
current subtitle (see ST_PS1); 1 - means print the whole article, 0 - means
print the current subtitle
But you don't need to know the meaning of these fields as you'll see ... By the
way, you can discard my previous email in which I explained how to process the
short URLs, you won't need to do it as you'll see below.
> that are added for a 'single page view', and how do these translate to
> the 'short urls' format?
You don't they remain as they are; example:
> I've only got printbox working with the 'template path' URLs at this
> stage, because with short URLs it is harder to specify the template
> because it needs an ID rather than a path.
> Mugur, can you give me some comments on the 'single page' urls please?
The solution I describe here is for BOTH long and short URLs and you don't need
to read and interpret the URL. All you need to do is use Campsite template
statements to generate the URL for you.
> I assume that if someone wants to print out an article, we want them to
> print out the whole article, rather than just a subsection?
Here is how you should generate the URL:
$printbox->add("http://example.com/
allsubtitles>");
(for details see manual chapter '3.9.4.1 URL, Form')
There are two constraints:
1. this PHP code MUST be inside Campsite "With" statement (see
article-extended.tpl template from demo package, or manual chapter '3.9.3.21
With').
2. The print template MUST be statically written in the template:
template article-print.tpl allsubtitles>
The following code WILL NOT work:
get_print_template(); ?> allsubtitles>
That is because the Campsite template statements are parsed before PHP code and
there is no way to change this order while still using Apache rewrite module
(as the current Campsite PHP wrapper works).
Best,
Mugur
____________________________________________________
Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
------------------------------------------
Posted to Phorum via PhorumMail