Hello, I found strange behaviour of in_menu which I don''t understand. I tried to create "Not found" page, which I obviously don''t want in my menu ;-) However, this simple page> --- > title: Page Not Found (in menu) > --- name:content pipeline:maruku > ## Page was not found on our site (in menu) > > Page you have requested was not found. >always ends up in menu, no matter how much I try to avoid it. When I change pipeline to empty, and change content to HTML, it doesn''t go into menu:> --- > title: Page Not Found (not in menu) > --- name:content pipeline: > <h2>Page was not found on our site (not in menu)</h2> > > <p>Page you have requested was not found.</p>Is this behaviour OK? I am attaching all my test pages in zip file. I am using webgen 0.5.3. -Peter Stibrany -------------- next part -------------- A non-text attachment was scrubbed... Name: in-menu-test.zip Type: application/x-zip-compressed Size: 2522 bytes Desc: not available URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20080831/e9fa0bc1/attachment.bin>
Am Sun, 31 Aug 2008 22:34:39 +0200 schrieb Peter Stibrany <pstibrany at gmail.com>:> Hello, > > I found strange behaviour of in_menu which I don''t understand. > > I tried to create "Not found" page, which I obviously don''t want in my > menu ;-) However, this simple page > > > --- > > title: Page Not Found (in menu) > > --- name:content pipeline:maruku > > ## Page was not found on our site (in menu) > > > > Page you have requested was not found. > > > always ends up in menu, no matter how much I try to avoid it. When I > change pipeline to empty, and change content to HTML, it doesn''t go > into menu: > > > --- > > title: Page Not Found (not in menu) > > --- name:content pipeline: > > <h2>Page was not found on our site (not in menu)</h2> > > > > <p>Page you have requested was not found.</p> > Is this behaviour OK? > > I am attaching all my test pages in zip file. I am using webgen 0.5.3.The webgen tag `menu` can be used to show different types of menus: - a menu with all nodes - a menu with just file nodes - a menu with just fragment nodes Since the default value for the option `tag.menu.used_nodes` is `all`, the first variant is used by default. So, now to your problem: the `in-menu.page` uses maruku as content processor and maruku automatically generates id attributes for headers. And webgen only generates fragment nodes for headers if they have an id attribute (otherwise they could not be referenced). Therefore webgen generates a fragment node for the `in-menu.page` but not for the `not-in-menu.page`. Since the default value of `tag.menu.used_nodes` is in use, the `in-menu.page` is shown in the menu since a sub entry of it is in the menu. To correct this, just replace your menu tag in `default.template` with {menu: {max_levels: 1, used_nodes: files}} Then everything works as expected! -- Thomas
Thank you! I tried to put id="test" attribute to my h2, and it also appeared in menu, exactly like you described. I was sure I was missing something, I just couldn''t find it. It seems I have a long path ahead of me to truly understand webgen ;-) -Peter On Mon, Sep 1, 2008 at 7:41 AM, Thomas Leitner <t_leitner at gmx.at> wrote:> Am Sun, 31 Aug 2008 22:34:39 +0200 > schrieb Peter Stibrany <pstibrany at gmail.com>: > >> Hello, >> >> I found strange behaviour of in_menu which I don''t understand. >> >> I tried to create "Not found" page, which I obviously don''t want in my >> menu ;-) However, this simple page >> >> > --- >> > title: Page Not Found (in menu) >> > --- name:content pipeline:maruku >> > ## Page was not found on our site (in menu) >> > >> > Page you have requested was not found. >> > >> always ends up in menu, no matter how much I try to avoid it. When I >> change pipeline to empty, and change content to HTML, it doesn''t go >> into menu: >> >> > --- >> > title: Page Not Found (not in menu) >> > --- name:content pipeline: >> > <h2>Page was not found on our site (not in menu)</h2> >> > >> > <p>Page you have requested was not found.</p> >> Is this behaviour OK? >> >> I am attaching all my test pages in zip file. I am using webgen 0.5.3. > > The webgen tag `menu` can be used to show different types of menus: > - a menu with all nodes > - a menu with just file nodes > - a menu with just fragment nodes > > Since the default value for the option `tag.menu.used_nodes` is `all`, > the first variant is used by default. > > So, now to your problem: the `in-menu.page` uses maruku as content > processor and maruku automatically generates id attributes for headers. > And webgen only generates fragment nodes for headers if they have an id > attribute (otherwise they could not be referenced). Therefore webgen > generates a fragment node for the `in-menu.page` but not for the > `not-in-menu.page`. Since the default value of `tag.menu.used_nodes` is > in use, the `in-menu.page` is shown in the menu since a sub entry of > it is in the menu. > > To correct this, just replace your menu tag in `default.template` with > > {menu: {max_levels: 1, used_nodes: files}} > > Then everything works as expected! > > -- Thomas > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users >