Forum OpenACS Development: variables on pages adp, tcl and xql

Collapse
Posted by Iuri Sampaio on
Hi there,
I am trying to understand how the variables are shown on ADP pages.

I have the following block written in the ADP page
if @caption@ not nil
#photo-album.Title: @caption@
/if

and this one that i just added.
if @photographer@ not nil
#photo-album.Photographer#: @photographer@
/if

In the TCL file i have references to the var "caption" in the header (obs: i added photographer as well)
} -properties {
context:onevalue
caption:onevalue
photographer:onevalue
}
...
somewhere else in the TCL page i have.

if {![db_0or1row get_photo_info { *SQL* }]} {
ad_return_complaint 1 "

  • [_ photo-album.

    which is the query that retrieves the photoinfo.
    The XQL file has:

    fullquery name="get_photo_info"
    querytext
    select
    pp.caption,
    pp.story,
    cr.title,
    cr.description,
    i.height as height,
    i.width as width,
    pp.photographer,
    ....

    I added the last one "photographer" as the same way "caption" is written. However it does not show in the ADP page as expected.

    Why does it happens?

  • Collapse
    Posted by Brian Fenton on
    Hi Iuri

    maybe $photographer doesn't have a value? Put an ns_log Notice "photographer=$photographer" just after your db_0or1row. It could be the XQL file isn't picking up your changes to the SQL query.

    Brian

    Collapse
    Posted by Jim Lynch on
    Heya Iuri,

    .xql files are loaded/cached at startup; you can restart the service or arrange to watch them in the APM.