Forum OpenACS Q&A: OACS Homepage Template/ETP Implementation

Hi - I'm sorry as I know this is a rather basic question, but I've searched through the forums and found nothing to answer it and the docs are not clear on this. :( I've been experimenting with the approach to setting up templates and etp for the homepage. I know that general-master is the default template for the site. I'm wondering how exactly does homepage-new-index.adp get called? I would really appreciate it if someone could explain in a bit of detail  the set-up for - especially how etp is set-up and how the templating works for the home page. I apologize as I know this is probably obvious and I'm just not seeing it, but I'm stuck on this point and would appreciate the assist. TIA.
Posted by Ola Hansson on

The instructions on how to set up etp for the homepage can be found here: or under /doc on your personal installation.

In the case of we made a homegrown "application" (how this is done is described in the etp docs, and you can see our implementation here: for etp that was just meant to be used on that instance of the etp packqage, i.e., the start page...

We associated this "homepage-new" etp application with the etp package instance via etp's "Change ETP Application" UI. The homepage-new application, in turn, specifies which template should be used for etp package instances that are associated with this particular application. In this case the template is "/www/templates/homepage-new-index" (here is the adp half of the template:
This template, as you can see, places the main etp instance content where the @pa.content@ variable is. There is no <slave> tag in this (etp) case. The template also <include>s different "widgets" such as postings and news and passes title properties to the different widgets. The widgets generally "dress" themselves in the "box-master" template by having a <master> tag at their top and they also propagate the title, as in this case, to the box-master. To get back to the "homepage-new-index" template ... *it* (and the content it's built up so far) gets wrapped or dressed in the the default-master template of the subsite at hand which, I think, happens to be "general-master" for the main subsite. The <master> tag uses the default-master of the subsite if there's no "src" specified, you know...

(The reason we didn't use the default default-master was that we didn't want to destroy the design that Musea had in place already when we started development of the new templates. So we changed to another "subsite master template" by changing the kernel param that decides this.)

I hope that this will help you grasp how things are put together, and if you don't it is due to my poor pedagogical skills.  Anyway, ask if something's unclear and I or someone else will try to make it clearer.

Now, if this is the way these things *should* be handeled is  a completely different matter altogether and a question which is debatable...

Posted by Randy Ferrer on

Ola - Thank you so much for your assistance. I got it all working now. :-)) I had everything set-up except for this bit - "We associated this "homepage-new" etp application with the etp package instance via etp's "Change ETP Application" UI." After setting this, everything clicked. I new it was something obvious that I was overlooking - a bit embarrassing really. I had gotten as far as writing a homepage-index.adp and .tcl pages, setting up etp, changed the master template etc. - everything you describe, but no joy.

Now, as far as your pedagogical skills - as far as I'm concerned, they are excellent. :-)) I had found bits and pieces in the forums but no clear explanations of how oacs was set-up. I had browsed the code and modeled my templates after it etc. but still had missing details. Now anyone who is interested in how is set-up, has a concise reference. Thanks again for the assist and your time in writing this up.

Posted by Ola Hansson on
Cool, and, you're welcome. :-)
Posted by Eric Wolfram on
Hi, I'm setting my site up with the same implementation and I could use just a bit more clarification (if anyone is subscribed to this thread still).

My question is: What is the end result of setting up the home pages with ETP? Does the "edit this page" link appear at the bottom of the home page to give certain people the privalage to edit that center content area -- the @pa.content@

I know how it's grabbing content from news, and box-master and all -- but I'm wondering if the center content is then editable?

Posted by Randy Ferrer on
Exactly Eric. For the example, @pa.content@ holds content authorized for publication via ETP. If all is set-up correctly, what happens is that an Edit-This-Page link appears on the home page assuming that you are an administrator. This takes you to the ETP interface allowing you to edit the content for that page or section of a page. This depends on your ETP set-up of course. In the case of's home page, you can write, edit and publish or make live -which ever terminology you prefer - the center content which is then sourced into the page via @pa.content@ on the adp page. I hope this clarifies a bit, but it sounds like you have the hang of it :-)
Posted by Eric Wolfram on
Thanks for the clarification. IT's not obvious...I'm stuck on something still. I've gone over all this many times and set up almost an identical system. However, mine is not yet behaving as I would expect.

I got the edit this page to appear on the / front page by putting some code into the default-master.adp and .tcl. ETP is using a templates/homepage as the application but the @pa.content@ is not showing up -- it's blank. So I click on "edit this page". Here's where I would expect to see the edit admin page...but what I really see is the homepage template WITH the @pa.content@. There is another "edit this page" link at the bottom of that page (the context menue says myhome > ETP) and when I click on that link I DO get to the edit admin page and I can edit @pa.content@ there.

So for / it's not working right. I noticed in index.vuh the following "trickery" but I don't understand it -- is the solution to my issue here?

from package/edit-this-page/www/index.vuh

if {[empty_string_p $name] || $name == "index"} {
    set path "/[etp::get_application_param index_template]"
} elseif {[string match "etp*" $name]} {
    # this "trickery" is for serving pages from the top level,
    # where the acs-subsite package is mounted rather than
    # the editthispage package.  normally the request processor
    # finds these before invoking this file.
    set path "/packages/edit-this-page/www/$name"
} else {

    set path "/[etp::get_application_param content_template]"

    # set up form variables so we can pass the "name"
    # variable to the content page.
    global _ns_form
    set _ns_form [ns_set create]
    ns_set put [ns_getform] "name" $name

Posted by Dave Bauer on

Do you have the edit-this-page package mounted at /etp?

If you do you will see this problem when you use the index.vuh for the home page.

Posted by Eric Wolfram on
Yes indeed I do have it mounted there! *Thats* the issue?Where do you have it mounted? OMG, that's the issue! I just changed it to /edit/ and it fixed the problem. Thanks, it would have taken a year for me to figure that out (at least.) Too bad we don't have 'edit this page' set up on those docs, because I'd add that little detail right now.

Thanks all!