Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.2.6. Powerful Lists and Ordering        5.2.8. Adding PHP Scripts to Your Campsite Templates>

Print / Download:
Available languages: english Last update: 2005-10-12 08:02:50

5.2.7. Environmental Control with Campsite Templates

Instructions within Campsite lingo fall into two categories: those that do not generate output but only select the environment for the rest of the instructions, and those that print a certain information from the database according to the environment set by the first type of instructions.

The information selected also depends on the runtime parameters. These parameters are:

  • language identifier (IdLang) which sets the current language
  • publication identifier (IdPubl) which sets the current publication
  • issue number (NrIssue) which sets the current issue
  • section number (NrSection) which sets the current section
  • article number (NrArticle) which sets the article
and also some special parameters:

  • the keywords parameter, which specifies that keywords will be used as filters in a List SearchResult statement; it is used for the local search engine
  • a list index start, that specifies the starting index for a each type of list: Issue (ILStart), Section (SLStart), Article (ALStart), Article search (SRLstart)
All runtime parameters form the so-called "data context" within which each article is positioned.

 


add a note add a note User Contributed Notes
5.2.7. Environmental Control with Campsite Templates
Mugur Rus  mugur1973 at yahoo dot com
Thursday 13th of October 2005 07:03:00 PM
> 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:

https://www.campware.org/en/today/news/2167?ST1=text&ST;_T1=extended&ST;_PS1=1&ST;_AS1=1&ST;_LS1=0&ST;_max=1

> 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/<!** URI template article-print.tpl
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: <!** URI
template article-print.tpl allsubtitles>

The following code WILL NOT work:
<!** URI template
<?php echo $printbox->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).

<5.2.6. Powerful Lists and Ordering 5.2.8. Adding PHP Scripts to Your Campsite Templates>

  Last update: 2005-10-12 08:02:50
Website powered by Docmint Last update: 2005-10-12 08:02:50
Total page time: 0.80081486702