[Zope] Zope and Paths

David Siedband david at calteg.org
Sat Nov 15 15:11:31 EST 2003


First create a zSQL method that retrieves the article content from 
database (selecting on the unique ID that you pass it).

For example
(assumes your articles table is called articles
and ID field is the unique ID)

select * from articles
where ID = <dtml-sqlvar id type=int>;

Then, in your page use a dtml-in to invoke the query

for example
(assumes the zSQL method is called selectArticleByID
and is inside a folder called queries)

<dtml-var standard_html_header>

   <dtml-in "queries.selectArticleByID()">

     <h1>Title: <dtml-var title></h1>
     <h2>Author: <dtml-var authorNameFirst> <dtml-var 
authorNameLast></h2>
     <br><br>
     <div class="storyText"><dtml-var articleText></div>

   </dtml-in>

<dtml-var standard_html_header>

HTH,
--
David

On Nov 15, 2003, at 9:43 AM, Faro wrote:

> Hi guys,
>
> I'd like to know if I can solve a simple problem:
>
> I'd like to manage path like that:
>
> www.site.com/Articles/32042
>
> as
>
> www.site.com/Articles/ViewArticle?id=32042
>
> How can I do it?? My method "ViewArticle" is inside the Article folder.
> There is an easy way to do it?? My articles are loaded form a 
> Database, so I
> can't create, for every article, a new Document (called with his ID) 
> for
> displaing it.
>
> tnx a lot, bye
>
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>




More information about the Zope mailing list