ZEXP((U OFS.FolderqUFolderqtqNt.}q(U_objectsq(}q(U meta_typeqUFolderqUidq Udataq u}q (U meta_typeq UScript (Python)q UidqU simple_treequ}q(U meta_typeqU Page TemplateqUidqU master_pagequ}q(U meta_typeqUScript (Python)qUidqUimage_batches_errorqu}q(U meta_typeqU Page TemplateqUidqU index_htmlqu}q(hhhUimage_batches.ptq u}q!(hUScript (Python)q"hU image_batchesq#u}q$(U meta_typeq%U Page Templateq&Uidq'U use_master.ptq(u}q)(h%h&h'U tree_menu.ptq*u}q+(h%h&h'U show_text.ptq,uth U zpt_examplesq-Udataq.(Uq/(hUFolderq0ttQU master_pageq1(Uq2(U'Products.PageTemplates.ZopePageTemplateq3UZopePageTemplateq4ttQU__ac_local_roles__q5}q6Uevanq7]q8UOwnerq9ash((Uq:(h3UZopePageTemplateq;ttQU_ownerq<(]q=U acl_usersq>ah7th(Uq?(U#Products.PythonScripts.PythonScriptq@U PythonScriptqAttQh*(UqB(h3UZopePageTemplateqCttQU image_batchesqD(UqE(h@U PythonScriptqFttQh (UqG(h3UZopePageTemplateqHttQh,(UqI(h3UZopePageTemplateqJttQUtitleqKUPage Template ExamplesqLU index_htmlqM(UqN(h3UZopePageTemplateqOttQh(UqP(h@U PythonScriptqQttQu.H((U OFS.FolderqUFolderqtqNt.}q(UidqUdataqU__ac_local_roles__q}qUevanq ]q UOwnerq asU_objectsq (}q (U meta_typeqU DTML MethodqUidqUmethod 1qu}q(hhhUmethod 2qu}q(U meta_typeqUImageqUidqUimage 1qu}q(hhhUimage 2qu}q(hhhUimage 3qu}q(hhhUimage 4qu}q(hhhUimage 5q u}q!(hhhUimage 6q"u}q#(hhhUimage 7q$u}q%(hhhUimage 8q&u}q'(hUFolderq(hU subfolderq)uth&(Uq*(U OFS.Imageq+UImageq,tq-tq.Qh$(Uq/(h+UImageq0tq1tq2Qh"(Uq3(h+UImageq4tq5tq6Qh (Uq7(h+UImageq8tq9tq:Qh(Uq;(h+UImageqQh(Uq?(h+UImageq@tqAtqBQh(UqC(h+UImageqDtqEtqFQh(UqG(h+UImageqHtqItqJQh(UqK(UOFS.DTMLMethodqLU DTMLMethodqMtqNtqOQh(UqP(hLU DTMLMethodqQtqRtqSQh)(UqT(hUFolderqUtqVtqWQUtitleqXUu.((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqU master_pageqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqTV The title

Click here to return to the index page, or here to view the template source.

This is Page Template .

Plug some text in here.

qU content_typeqU text/htmlqUtitleqU Master Pagequ.((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqU use_master.ptqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqTq The title

Click here to return to the index page.

Totally Different Text.

Plug some text in this slot.

Plug some text in here too.

qU content_typeqU text/htmlqUtitleqUUses Master Pagequ.((U#Products.PythonScripts.PythonScriptqU PythonScriptqtqNt.}q(U func_codeq(cShared.DC.Scripts.Signature FuncCode qoq}q(U co_varnamesq (Uerrorq U_getitemq U_getattrq U_printq tqU co_argcountqKubU_paramsqUerrorqUidqUimage_batches_errorqU__ac_local_roles__q}qUevanq]qUOwnerqasU _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q(Uname_containerqU containerq U name_m_selfq!Uscriptq"Uname_nsq#Unsq$U name_contextq%Ucontextq&usbU func_defaultsq'NU_codeq(TcsdZdS(Ncst}t}t}do>|dIJ|d||tddIJ|Sn||d||ddS(NisC

You are not authorized to view one or more of these images

s/Click here to skip them.sREQUESTsURLs error_types error_value(s _getitem_s_getitems _getattr_s_getattrs_print_s_prints containerserror(serrors_getitems_getattrs_print((sScript (Python)simage_batches_errors #(simage_batches_error(((sScript (Python)ssq)U_bodyq*T if 1: #error.error_type == 'Unauthorized': print '

You are not authorized to view one or more of these images

' print 'Click here to skip them.' % container.REQUEST['URL'] return printed raise error.error_type, error.error_value q+U Script_magicq,KUwarningsq-)Uerrorsq.)U Python_magicq/U* q0u. ((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqU tree_menu.ptqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqT The title

Click here to return to the index page, or here to view the template source.

Metatype Id
Metatype Id
qU content_typeqU text/htmlqUtitleqUu.((U#Products.PythonScripts.PythonScriptqU PythonScriptqtqNt.}q(U func_codeq(cShared.DC.Scripts.Signature FuncCode qoq}q(U co_varnamesq (U_getattrq U url_queryq UBatchq Ureqq Ub_startqUimagesqUbatchqUb_urlqtU co_argcountqKubU_paramsqUUidqU image_batchesqU__ac_local_roles__q}qUevanq]qUOwnerqasU _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q (Uname_containerq!U containerq"U name_subpathq#Utraverse_subpathq$U name_m_selfq%Uscriptq&U name_contextq'Ucontextq(usbU func_defaultsq)NU_codeq*T?csdZdS(Nc4st}dkl}l}|td}t||ddd}||tddd} ||d |d d d ||dd } ||dd}h|d<|dsq+U_bodyq,Tfrom ZTUtils import url_query, Batch req = container.REQUEST # Get the starting offset b_start = int(req.get('b_start', 0)) # Make a batch of image objects, 3 at a time images = container.data.objectValues('Image') batch = Batch(images, 3, b_start, orphan=1, skip_unauthorized=req.get('perm')) # Make a batch URL that is the same as the REQUEST URL without 'b_start' b_url = url_query(req, omit='b_start') return {'batch': batch, 'b_url': b_url} q-U Script_magicq.KUwarningsq/)Uerrorsq0)U Python_magicq1U* q2u.((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqUimage_batches.ptqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqTQ The title
Previous n

A) Image Id:

Next n
qU content_typeqU text/htmlqUtitleqUBatches of Imagesqu.Z((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqU show_text.ptqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqT 

Here is some DTML

DTML Method 1 of n: "Id"
Source
Source
Rendered
Rendered
qU content_typeqU text/htmlqUtitleqUu.d((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(UexpandqKUidqU index_htmlqU__ac_local_roles__q}q Uevanq ]q UOwnerq asU _bind_namesq (cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}qU name_subpathqUtraverse_subpathqssbU_textqT The title

content title or id optional template id

Here are some examples of Zope Page Template use:
Image Batches This example displays images in batches of three. One of the images has View permission turned off, so this also demonstrates error handling and skip_unauthorized.
Macro Usage This example uses a full-page macro, and uses a paragraph macro twice.
Object Tree This example uses the SimpleTreeMaker to simulate the ZMI left panel tree.
Object Access and HTML This example accesses several objects and shows the difference between structure and text insertion.
qU content_typeqU text/htmlqUtitleqUIndexqu. ((U#Products.PythonScripts.PythonScriptqU PythonScriptqtqNt.}q(U func_codeq(cShared.DC.Scripts.Signature FuncCode qoq}q(U co_varnamesq (U tree_rootq Utree_preq U_getattrq USimpleTreeMakerq UtmqUtreeqUrowsqtU co_argcountqKubU_paramsqUtree_root, tree_preqUidqU simple_treeqU__ac_local_roles__q}qUevanq]qUOwnerqasU _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q (Uname_containerq!U containerq"U name_subpathq#Utraverse_subpathq$U name_m_selfq%Uscriptq&U name_contextq'Ucontextq(usbU func_defaultsq)NU_codeq*TxcsdZdS(Ncst}dkl}||}||dd||d|\}}||ddh|d<|dsq+U_tq,(hN(KKKKTht }|t!}t"}t#}klllklld|}d|}||}  |t i }  || i|}  | oA ||| ii|}  | o|| d\} }}|| t|\} \}}|tjon| djo[|||tjo ht|<|||Ureqq?Ugetq@UstateqAUformqBUsetstqCUstqDUpnqEUexpidqFUintqGUmUobidqHUNoneqIUtreeqJU tree_rootqKUflatqLh1URESPONSEqMU setCookieqNUpopqOU $loop_watcherqPU $read_guardqQU $write_guardqRU$guardqSt(hKh9h3h4h5h7h8h:h;h

This is the Document in the Folder. The request argument is &dtml-reqarg;!

qU_varsq}qu.]((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(U__ac_local_roles__q}qUevanq]qUOwnerq asU__name__q Umethod 2q Utitleq U With Titleq U#_View_management_screens_Permissionq]qU AnonymousqaUglobalsq}qUrawqUt

I was called by .

qU_varsq}qu.((U OFS.FolderqUFolderqtqNt.}q(UidqU subfolderqU__ac_local_roles__q}qUevanq ]q UOwnerq asU_objectsq (}q (U meta_typeqUFolderqhUsubsub 1qu}q(hhhUsubsub 2quth(Uq(hUFolderqtqtqQh(Uq(hUFolderqtqtqQUtitleqUu.((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUsubsub 1q(Uq(hUFolderqtq tq QUidq Usubsub 2q U__ac_local_roles__q }qUevanq]qUOwnerqasU_objectsq(}q(U meta_typeqUFolderqUidqUsubsub 1qutqu.((U OFS.FolderqUFolderqtqNt.}q(Usubsub 1q(Uq(hUFolderqttqQUidq hU__ac_local_roles__q }q Uevanq ]q UOwnerqasUsubsub 2q(Uq(hUFolderqtqtqQU_objectsq(}q(U meta_typeqUFolderqh Usubsub 1qu}q(hhh Usubsub 2qutUtitleqUu.((U OFS.FolderqUFolderqtqNt.}q(Usubsub 1q(Uq(hUFolderqtqtq QUidq hU__ac_local_roles__q }q Uevanq ]qUOwnerqasUsubsub 2q(Uq(hUFolderqtqtqQU_objectsq(}q(U meta_typeqUFolderqh Usubsub 1qu}q(hhh Usubsub 2qutUtitleqUu.r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 1qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu.((U OFS.FolderqUFolderqtqNt.}q(Usubsub 1q(Uq(hUFolderqtqtq QUidq Usubsub 2q U__ac_local_roles__q }q Uevanq]qUOwnerqasUsubsub 2q(Uq(hUFolderqtqtqQU_objectsq(}q(U meta_typeqUFolderqUidqUsubsub 1qu}q(hhhUsubsub 2qutUtitleqUu.r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 1qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu.((U OFS.FolderqUFolderqtqNt.}q(UidqUsubsub 2qU__ac_local_roles__q}qUevanq ]q UOwnerq asU_objectsq (}q (U meta_typeqUFolderqUidqUsubsub 1qu}q(hhhUsubsub 2qutUsubsub 2q(U q(hUFolderqtqtqQUsubsub 1q(U q(hUFolderqtqtqQUtitleqUu.((U OFS.FolderqUFolderqtqNt.}q(Usubsub 1q(U q(hUFolderqtqtq QUidq hU__ac_local_roles__q }q Uevanq ]qUOwnerqasUsubsub 2q(U q(hUFolderqtqtqQU_objectsq(}q(U meta_typeqUFolderqh Usubsub 1qu}q(hhh Usubsub 2qutUtitleqUu.r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 2qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu. r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 2qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu. ((U OFS.FolderqUFolderqtqNt.}q(UidqUsubsub 1qU__ac_local_roles__q}qUevanq ]q UOwnerq asU_objectsq (}q (U meta_typeqUFolderqhUsubsub 1qu}q(hhhUsubsub 2qutUsubsub 2q(U q(hUFolderqtqtqQh(Uq(hUFolderqtqtqQUtitleqUu. r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 1qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu. r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 2qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu. r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 2qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu.r((U OFS.FolderqUFolderqtqNt.}q(UtitleqUUidqUsubsub 1qU__ac_local_roles__q}q Uevanq ]q UOwnerq asu.