Forum OpenACS Q&A: Re: Current state of theming in OpenACS (without .LRN)

Collapse
Posted by Prem Thomas on

Property problem drove me batty but now solved. In the past title was passed using the property 'title.' Now many properties are passed in an array named 'doc': so doc(title), doc(title_lang), doc(type), etc.. There's another array, body, referenced in /serviceRoot/www/blank-master.tcl.

Set doc(title), and any other keys for the doc array, in the .tcl file. Then reference the array 'doc' using a pass by reference syntax in the adp file.

foobar.tcl
----------
ad_page_contract {
  Testing
} {
} -properties {
    doc
    context
}

set package_id [ad_conn package_id]
set title "foobar"
set doc(title) $title
set context [list $title]
ad_return_template

foobar.adp
----------
<master>
<property name="context">@context@</property>
<property name="&doc">doc</property>

So &doc declares a variable 'doc' which gets its reference from the symbol, doc, between the property tags. Simple for many, perhaps, but it escaped me.

I read a post in these forums by someone who said a thorny OACS configuration had him 'in tears.' Many moons earlier, while traversing some Solaris/opensolaris forum, I read a similar, stronger sentiment: compiling code in Solaris could 'drive one suicidal.' I think, perhaps, that the personalities drawn to OACS and Solaris are alike: moths irresistably drawn by the promised power of these systems and then consumed by their complexity. I can certainly empathize.

Collapse
Posted by Jim Lynch on

Sometimes people try to focus on all the levels of the code (stuff they write, stuff that gets called, the sql stuff invoked as part of it, the declarative syntax of ad_form, etc etc)... and this can produce the exact experiences you describe... and, many times you have to pay attn to more than one level while you're learning.

I'm glad you have seen and fully checked out the master templates. In particular, notice that openacs-default-theme uses the blank-master in (yourSite)/www/blank-master.* and that only some of the files that define the html that goes out, are in the theme package. I don't know the reason, Don Baccus wrote that package and may be able to shed some light.

So &doc declares a variable 'doc' which gets its reference from the symbol, doc, between the property tags. Simple for many, perhaps, but it escaped me.
Until now, and congrats. You read it and you immediately understood, and now you can use it. Perfect. That's all that's required. "Simple for many": it's simple for the ones who wrote it, use it all the time or at minimum, read the instructions. There is every reason that you can become the one it's simple for, and, that of course will take effort, work and practice. No shortcut. Just put in the time.