Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.2.8. Adding PHP Scripts to Your Campsite Templates        5.3.1. Language Elements: Conventions>

Print / Download:
Available languages: english Last update: 2005-08-25 17:15:18

5.3. Template Language Reference

Table of Contents
5.3.1. Language Elements: Conventions
5.3.2. Language
5.3.3. Publication
5.3.4. Issue
5.3.5. Section
5.3.6. Article
5.3.7. Local
5.3.8. Topic
5.3.9. List of Issues
5.3.10. List of Sections
5.3.11. List of Articles
5.3.12. List of Subtitles
5.3.13. List Search Result
5.3.14. If NextItems | PreviousItems
5.3.15. If NextSubtitles | PrevSubtitles
5.3.16. If List
5.3.17. Include
5.3.18. If Publication
5.3.19. If Issue
5.3.20. If Section
5.3.21. If Article
5.3.22. If Allowed
5.3.23. If Subscription
5.3.24. If Login
5.3.25. If User
5.3.26. If CurrentSubtitle
5.3.27. If Image
5.3.28. If Language
5.3.29. With
5.3.30. If Search
5.3.31. If Subtitle
5.3.32. If Topic
5.3.33. URL, Form
5.3.34. Print
5.3.35. Date
5.3.36. Subscription
5.3.37. User
5.3.38. Login
5.3.39. Logout
5.3.40. Search
5.3.41. Edit
5.3.42. Select

The structure of the Campsite templates is simple. It is a continuous row of either HTML language or the commands used by Campsite to pull content out of the database. Any template in its most simplified form looks like this:

[HTML text] [Campsite Instruction] [HTML text ] [Campsite Instruction] ....

The following example is an HTML beginning of a Campsite template. In general, the best way to go about making templates is to finish the HTML layout work, then identify the chunks that do not need any changes and insert Campsite tags in-between to customize the layout.

<html><body><h1>template 1</h1></body></html>

This template does not contain Campsite Instructions. Taking this example a little bit further, the above example could be asked to display the day of the month.

<html><body> <!** Date mday> </body></html>

This template is made of:

HTML text: <html><body>

Campsite Instruction: <!** Date mday>

HTML text: </body></html>

... and will print the day of the month (numeric) for the current date. You can see the most important format standard that will follow all work through the pages to come, the Campsite tag. Requests to Campsite to replace a part of the template with information from the database is always inside the <!** > tag.

Template 3:

<html><body>
<!** List Article OnFrontPage Is On>
<p> Article Name <!** Print Article name>
<!** EndList>
</body></html>

This template is made of:

HTML text

<html><body>

Campsite Instruction

<!** List Article OnFrontPage Is On>

HTML text

<p> Article Name

Campsite Instruction

<!** Print Article name>

Campsite Instruction

<!** EndList>

HTML text

</body></html>

... and will print the names of articles that are on the front page, no matter if they are protected or not by the subscription system.

Beware that depending on the given runtime parameters this template will print different information. For example, if only NrIssue parameter is specified, this template will select all articles to be shown on the front page, for the given issue number, for all publications.


add a note add a note User Contributed Notes
5.3. Template Language Reference
Douglas Arellanes  douglas dot arellanes at mdlf dot org
Tuesday 02nd of August 2005 06:39:00 PM
Question:
How do Campsite templates interact with CSS files? Where, for example, should users upload their CSS files? Are there any tips/tricks for using CSS with Campsite templates?

Answer:
CSS files can be uploaded anywhere in the templates directory.

When including CSS files always print the absolute URI:
<link rel="stylesheet" type="text/css" href="/look/[path_to_css]/[css_file_name]">

<5.2.8. Adding PHP Scripts to Your Campsite Templates 5.3.1. Language Elements: Conventions>

  Last update: 2005-08-25 17:15:18
Website powered by Docmint Last update: 2005-08-25 17:15:18
Total page time: 1.13654708862