Hi everyone. Sorry if it is not the place to post questions about webgen. I use webgen5, i know it is not the stable version but i couldn''t understand how webgen4 worked, it''s easier with webgen5, and i won''t have to change my pages when it becomes mainstream ;) I try to build my homepage using webgen, and there are some things i don''t know how to do (i am sure i could do them using the API interface, but i am new to ruby and i''d rather use the standard user interface). - Is it possible to have different menus? I''d like to generate two menus, one with the important pages, and another one with the usual pages (which include the important pages). I can use the in_menu meta information for the usual pages, but i would like to be able to use some thing like {menu: {class: important}} for the important pages. Is there a way to do this? - let''s say i have a sidebar that i want to populate on some pages. I can do this using a block sidebar on theses page and having this on my template: <% if node.node_info[:page].blocks.has_key?(''sidebar'') %> <webgen:block name=''sidebar'' /> <% end %> (this is taken from the faq). However, if i use a special template in a new directory: foo/ default.template, the root template /default.template will not find the block sidebar in foo/default.template: Node </foo/default.template> has no block named ''sidebar'' What happen is that a page in foo/ has a sidebar block, so node.node_info... returns true, but webgen:block name=''sidebar'' looks only to the next file in the chain of template: foo/default.template, which does not exist, hence the error. I can use this trick: add a sidebar block in foo/default.template like this --- name:sidebar <% if node.node_info[:page].blocks.has_key?(''sidebar'') %> <webgen:block name=''sidebar /> <% end %> but this is not really satisfying, that means that if i add a new possible block include in /defautl.template, i have to modify all my specific templates. Is there a way to make <webgen:block name=''sidebar''> look for the first file containing the sidebar block in the template chain? I think this would resolve the problem. - In {sitemap: }, the sitemap generated does not show the files foo/ index.html (or the corresponding index file of the directory), rather foo links directly to foo/index.html. But this work only if there are other files in foo than the index page. If there is only foo/index.html, foo won''t be shown in the sitemap (except if we use used_node: all). Is there a way to make foo still appear (if foo/index.html is in the menu)? Thanks for any help! I would like to thank the author of webgen which is way more powerfull than what i would have written by hand (and in perl... webgen got me to look into ruby ;))
Hi,> Hi everyone. Sorry if it is not the place to post questions about > webgen. I use webgen5, i know it is not the stable version but i > couldn''t understand how webgen4 worked, it''s easier with webgen5, and > i won''t have to change my pages when it becomes mainstream ;)Any questions about webgen are welcome here :-)> - Is it possible to have different menus? I''d like to generate two > menus, one with the important pages, and another one with the usual > pages (which include the important pages). I can use the in_menu meta > information for the usual pages, but i would like to be able to use > some thing like {menu: {class: important}} for the important pages. Is > there a way to do this?It is currently only possible to have one menu tree (ie. all nodes with the in_menu meta info set) but it may be possible in the future to generate a menu from nodes specifying other conditions than in_menu.> - let''s say i have a sidebar that i want to populate on some pages. I > can do this using a block sidebar on theses page and having this on my > template: > <% if node.node_info[:page].blocks.has_key?(''sidebar'') %> > <webgen:block name=''sidebar'' /> > <% end %> > (this is taken from the faq). > > However, if i use a special template in a new directory: foo/ > default.template, the root template /default.template will not find > the block sidebar in foo/default.template: > Node </foo/default.template> has no block named ''sidebar'' > What happen is that a page in foo/ has a sidebar block, so > node.node_info... returns true, but webgen:block name=''sidebar'' looks > only to the next file in the chain of template: foo/default.template, > which does not exist, hence the error. > > I can use this trick: add a sidebar block in foo/default.template like > this > --- name:sidebar > <% if node.node_info[:page].blocks.has_key?(''sidebar'') %> > <webgen:block name=''sidebar /> > <% end %> > but this is not really satisfying, that means that if i add a new > possible block include in /defautl.template, i have to modify all my > specific templates. > > Is there a way to make <webgen:block name=''sidebar''> look for the > first file containing the sidebar block in the template chain? I think > this would resolve the problem.I know of this problem. It will be fixed in one of the next releases.> - In {sitemap: }, the sitemap generated does not show the files foo/ > index.html (or the corresponding index file of the directory), rather > foo links directly to foo/index.html. > But this work only if there are other files in foo than the index > page. If there is only foo/index.html, foo won''t be shown in the > sitemap (except if we use used_node: all). Is there a way to make foo > still appear (if foo/index.html is in the menu)?This seems like a bug - will have a look at this!> Thanks for any help! > I would like to thank the author of webgen which is way more powerfull > than what i would have written by hand (and in perl... webgen got me > to look into ruby ;))Thanks! And I really suggest looking more into ruby, it is a *very* nice language! -- Thomas
> Is there a way to make <webgen:block name=''sidebar''> look for the > first file containing the sidebar block in the template chain? I think > this would resolve the problem.I have modified the ContentProcessor::Blocks to allow this behaviour. Available with the next release.> - In {sitemap: }, the sitemap generated does not show the files foo/ > index.html (or the corresponding index file of the directory), rather > foo links directly to foo/index.html. > But this work only if there are other files in foo than the index > page. If there is only foo/index.html, foo won''t be shown in the > sitemap (except if we use used_node: all). Is there a way to make foo > still appear (if foo/index.html is in the menu)?Bug fixed with next release. -- Thomas