View · Index

ADP Files

  • Avoid putting in Tcl code on ADP pages if possible

    Although AOLserver/NaviServer ADP supports placing Tcl codes directing into ADP pages, one should used the ADP system wherever possible (see e.g.  Using Templates in OpenACS or OpenACS Templating System).

  • Quote in the master, pass "properties" literally from slave adp files

    when variables are used in templates without modifiers (marked with a ";") then the values of the variables are internationalized and html-quoted. The substitutions should be done at the place, where the variables are actually used, which is for "properties" in the master templates. That the places, where the variable values are just passed on, the modifier ";literal" should be used to prevent quoting and internationalization.

    Master:
       <head> 
       <title>@doc.title@</title>
       </head> 
       <body bgcolor="#ffffff"> 
       <h1>@heading@</h1> 
       <slave> 
       </body>
    Slave:
       <master> 
       <property name="doc(title)">@title;literal@</property> 
       <property name="heading">@title;literal@</property> 
       ...
    Passing arguments to ADP includes:
       <include src="name-of-included-adp" ... var="@value;literal@" ...>
    
    or one can pass variables via reference to the include
       <include src="name-of-included-adp" ... &="varName" ...> 
  • Pass always the "context" and "doc(title)" properties to the site master template
    Example:
       <property name="doc(title)">@title;literal@</property>
       <property name="context">@context;literal@</property>
  • Quote HTML attributes

    Quoting HTML attribute values improves the safety against XSS attacks, especially when the attribute values are variables. Double quotes are preferred over single quotes, both are fine.

  • Common doc properties
    The following doc properties are used in the blank-master template:

    • doc(title): Title of the document
    • doc(lang): Language of the document
    • doc(type): HTML doc type declaration
    • doc(base_href): The base URL to be used throughout the document for relative URLs (see base element)
    • doc(base_target): A keyword or author-defined name of the default browsing context to display the result when links or forms cause navigation, for <a> or <form> elements without an explicit target attribute. (see base element)

       

previous November 2024
Sun Mon Tue Wed Thu Fri Sat
27 28 29 30 31 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Popular tags

17 , 5.10 , 5.10.0 , 5.10.1 , 5.9.0 , 5.9.1 , ad_form , ADP , ajax , aolserver , asynchronous , bgdelivery , bootstrap , bugtracker , CentOS , COMET , compatibility , CSP , CSRF , cvs , debian , docker , docker-compose , emacs , engineering-standards , exec , fedora , FreeBSD , guidelines , host-node-map
No registered users in community xowiki
in last 30 minutes
Contributors

OpenACS.org