Zope
  Home arrow Zope arrow Page 3 - ZPT Basics (part 1)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ZOPE

ZPT Basics (part 1)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2002-09-18

    Table of Contents:
  • ZPT Basics (part 1)
  • The Power Of Three
  • Practical Magic
  • Anatomy Lesson
  • Putting It All In Context

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    ZPT Basics (part 1) - Practical Magic
    (Page 3 of 5 )

    Let's take a look at a more concrete example of how TAL works. Start up Zope and log in to the management interface with the user name and password that was created when you installed Zope.

    As you should know by now, this is the tool that you will be using to build your Web applications. You can use it to create documents, folders, and your own Zope products. And the first step in this process is to create a folder to store all the objects we're going to be creating.

    Create a Folder by selecting it from the drop-down menu that appears at the top of the page, and name it "ZPT Basics".

    The next step is to navigate to the folder that you just created and add a Page Template to it, using the process outlined above.



    Give this template an ID of "MyFirstTemplate", and a title of "Hello ZPT!".

    As you may have guessed by now, the object ID that you assign at each stage is fairly important - it provides a unique identifier for the object within Zope, which can be used to access and manipulate it from your scripts.

    A default page template will be created in the "ZPT Basics" folder. Replace the code within it with the following:

    <html> <head> <title tal:content="template/title">The title</title> </head> <body> <h2>Welcome to <span tal:replace="here/title_or_id">content title or id</span></h2> This is a Page Template with ID <em tal:content="template/id">template id</em> and title <em tal:content="template/title">template title</em>. </body> </html>
    Here's the output of this template (you can see this via the "Test" option in the Zope management interface),



    and here's the corresponding HTML code generated by Zope.

    <html> <head> <title>Hello ZPT!</title> </head> <body> <h2>Welcome to ZPT Basics</h2> This is a Page Template with ID <em>MyFirstTemplate</em> and title <em>Hello ZPT!</em>. </body> </html>

    More Zope Articles
    More By Harish Kamath, (c) Melonfire


     

       

    ZOPE ARTICLES

    - Creating Zope Products
    - Plone Content Types With Archetypes
    - Flat User Management in Zope
    - Creating Basic Zope Applications
    - Getting started with Zope for Linux and Sola...
    - ZPT Basics (part 4)
    - ZPT Basics (part 3)
    - ZPT Basics (part 2)
    - ZPT Basics (part 1)
    - Exception Handling In DTML
    - DTML Basics (part 4)
    - DTML Basics (part 3)
    - DTML Basics (part 2)
    - DTML Basics (part 1)
    - Using Zope With Apache




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway