Re: Template-trouble

Yuri Smetsers <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Hi Clemens,

 >>Hm, I have never heard about this CoolMenus stuff ... however
 >>if You want to filter for non-empty folders,
 >> You maybe could use the "is_published" method [ ... ]
The method works fine, thanks.
However, combining "is_published" with Coolmenu's Javascript puzzles me.

I managed to get it working, but it looks very sloppy:

[snip[

<script tal:condition="here/portfolio/is_published">
oM.makeMenu('portfolio','','','/twin/portfolio/','',83,16,'/twin/images/nav/hoofdmenu/03_portfolio.gif','/twin/images/nav/hoofdmenu/03_portfolio_mo.gif','','','top')
</script>
<script tal:condition="here/opdrachtgevers/is_published">
oM.makeMenu('opdrachtgevers','','','/twin/opdrachtgevers/','',122,16,'/twin/images/nav/hoofdmenu/04_opdrachtgevers.gif','/twin/images/nav/hoofdmenu/04_opdrachtgevers_mo.gif','','','top')
</script>
<script tal:condition="here/contact/is_published">
oM.makeMenu('contact','','','/twin/contact/','',75,16,'/twin/images/nav/hoofdmenu/05_contact.gif','/twin/images/nav/hoofdmenu/05_contact_mo.gif','','','top')
</script>

[/snip]

The oM.makeMenu-statements originally were placed in a seperate 
.js-file, which a) looked nice and b) was easy to maintain.
Inserting TAL into a .js-files doesn't seem to work, so I now have to 
insert the menu-code in each layout_macro.

Is there a better way to do this?

Again, thanks a million.

Regards,
Yuri Smetsers

Clemens Robbenhaar wrote:

>Hi Yuri,
>
> some short reply:
>
> > 
> > As said, the left column is used for navigation/indexing. Example: at 
> > the 'people'-section, the left-column should contain a full listing of 
> > all employee-templates in the 'people'  folder. (Each employee has its 
> > own template with some info.)
> > I tried using a separate template called 'left', which contained a 
> > manually maintained listing. Not an option. ;)
> > 
> > Is there a way to retrieve a listing of templates in a folder, filter 
> > and display them?
>
> Have You looked as the API.txt? The current version should be available here:
>
>http://cvs.infrae.com/SilvaDocumentation/API.txt?rev=1.12&content-type=text/vnd.viewcvs-markup
>
>
> If You want, You _can_ include another page template (or DTML if that
>fits You better) via some line like:
>
>  <tal:block content="structure here/left" />
>
>Anyway hand maintaned lists are a bad option if the software gives You
>things like the "get_ordered_publishables", which is most probably what
>You want to look for.
>
> > #2)
> > 
> > For the menu, I used dhtmlcentral's CoolMenus. It's a Javascript-based 
> > script which uses it's own stylesheet.
> > Our adapted version looks like this:
> > 
> > [ item][ item ][ item ][ item ] [ ... ]
> > 
> > Implementing the menu was quite easy, but it has to be dynamic. So if 
> > i.e. section News has no items, item 'News' shouldn't be visible.
> > Is it possible to check for a section whether it's filled or not?
>
> Hm, I have never heard about this CoolMenus stuff ... however 
>if You want to filter for non-empty folders, You maybe could use the
>"is_published" method. For folders this is true iff it contains
>published objects, which is most proabaly what You want ... if would not
>make a lot of sense to show a link to the 'News' section if its not
>empty but none of the content objects inside are published.
>
>Hope this helps a little,
>Clemens
>
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.