Forum OpenACS Development: Small enhancements proposal for xowiki

Hi,

it is the first time I found myself using xowiki for a job. From time to time I have tried to approach it, because I think it is the summa of everything OpenACS is capable of and could be the right tool for a lot of applications we ended up building by hand.

This time I've started plain, as a regular user, following the tutorial in the docs. Don't know what could possibly be different, but this time I have found everything very easy to understand and was capable of building a multi language webpage, with menu from categories and multimedia in a short time.

Putting hands on it made me reflect about some little enhancements that could be implemented with small effort in my opinion.

1) The categories includelet: I have found weird that the default title for this includelet is "categories" and not the localized name of the category tree it is showing. I had to put the name by hand in every page. Also, the locale of the includelet should default to the one of the page I am seeing, while I had to specify it explicitly every time.

2) Audio integration: under Chrome (at least), audio integration comes out weird, like it is falling back to HTML5 player, but into a wrongly sized iframe. Also, the autostart parameter seems to don't have effect, and the song keeps firing every time I open the page. I think we could check for browser version and when one supports HTML5, use that, keeping the "embed" implementation just for older ones.

3) Localization of pages: let's say I have created a page called "page1" in the italian language. I have added into the page the markup to add its english version, but this doesn't exist yet. When I click on the small flag in my page, I'm redirected tho the creation of the english version. This is ok, but I think such new page should be initialized with the contents from the italian version (or the one from the default locale, if exists). Of course I can copy/paste from it opening another tab, but 99% of the times I just need to change the text in the page, while a lot of stuff, like images, tables and so on, stays the same. What do you think about it?

Collapse
Posted by Antonio Pisano on
Ok, i gave a look to the code: actually categories includelet can show more than one category at a time if you pass a tree_name like "MyTree1 MyTree2". If you don't pass any tree_name, all mapped trees are shown.

I thought this includelet could show only one tree at a time! Now the presence of a separated "title" parameter makes sense. One could call it "Menu" for instance and let categories be shown, with tree name localized properly.

So far, so good. I then tried to understand how I could avoid to specify the locale to the includelet. I'd like it to understand that if it has been placed on a page in english, it should use the english locale.

In the code I couldn't find a way for the includelet to refer to the locale of its including page... I can use [ad_conn locale] or [::xo::cc locale], but this will return my language, not the one of the page... any suggestion?

Collapse
Posted by Antonio Pisano on
Figured it out: reference to including page is not so misteriously into class variable __including_page.

I could make it so one can avoid specifying the locale.

To cover the use case of "one tree per includelet", I have also added this modification: if includelet contains only one tree and no title was specified, use the name of the tree as title and activate "no_tree_name" parameter, so title doesn't get repeated 2 times.

Is it ok if I commit?