Hello, suppose I have this metadata in screenshots.page: title: Screenshots of my program in action inMenu: true I want to include it in menu with "Screenshots" title only, not full "Screenshots of my program in action" title. Is that possible with webgen? My goal is to have <title> tag in resulting HTML descriptive, but keep menu items short. Thank you, -Peter Stibrany
> Hello, > > suppose I have this metadata in screenshots.page: > > title: Screenshots of my program in action > inMenu: true > > I want to include it in menu with "Screenshots" title only, not full > "Screenshots of my program in action" title. Is that possible with > webgen? > > My goal is to have <title> tag in resulting HTML descriptive, but keep > menu items short.If you don''t mind to have the short title in every link to a page, you could add the following meta information to a page: title: Some long title used probably somewhere but not in the menu link_attrs: :link_text: Short link title for menu The special value `:link_text` of the meta information `link_attrs` is used to specify the text that should be used for a link to the page. So this title text does not only appear in menu links but also in other links to this page, for example, when using the breadcrumb_trail tag. -- Thomas
Hello, thank you for response. I was not able to get link_attrs working in webgen 0.5.3. I tried various syntax variations, but with no luck. But I solved my problem in other way. I simply added "htmltitle" metadata into my page: title: Short link title for menu htmltitle: Some long title used in HTML header and I use following snippet in my default.template: <% if node.meta_info.has_key?("htmltitle") %> <title>{htmltitle:}</title> <% else %> <title>{title:}</title> <% end %> -Peter On Sun, Aug 31, 2008 at 9:45 AM, Thomas Leitner <t_leitner at gmx.at> wrote:>> Hello, >> >> suppose I have this metadata in screenshots.page: >> >> title: Screenshots of my program in action >> inMenu: true >> >> I want to include it in menu with "Screenshots" title only, not full >> "Screenshots of my program in action" title. Is that possible with >> webgen? >> >> My goal is to have <title> tag in resulting HTML descriptive, but keep >> menu items short. > > If you don''t mind to have the short title in every link to a page, you > could add the following meta information to a page: > > title: Some long title used probably somewhere but not in the menu > link_attrs: > :link_text: Short link title for menu > > The special value `:link_text` of the meta information `link_attrs` is > used to specify the text that should be used for a link to the page. So > this title text does not only appear in menu links but also in other > links to this page, for example, when using the breadcrumb_trail tag. > > -- Thomas > > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users >
Am Sun, 31 Aug 2008 19:13:02 +0200 schrieb "Peter Stibrany" <pstibrany at gmail.com>:> Hello, > > thank you for response. I was not able to get link_attrs working in > webgen 0.5.3. I tried various syntax variations, but with no luck. > > But I solved my problem in other way. I simply added "htmltitle" > metadata into my page: > > title: Short link title for menu > htmltitle: Some long title used in HTML header > > and I use following snippet in my default.template: > > <% if node.meta_info.has_key?("htmltitle") %> > <title>{htmltitle:}</title> > <% else %> > <title>{title:}</title> > <% end %>Have a look at http://pastie.org/263598 . This shows a page file that uses the link_attrs meta information. -- Thomas
Thank you, Thomas. When I use this snippet it works fine. I used exact same syntax before, and it didn''t work, but I was probably doing something wrong. I''ll use your solution. Thanks. -Peter On Sun, Aug 31, 2008 at 8:58 PM, Thomas Leitner <t_leitner at gmx.at> wrote:> Am Sun, 31 Aug 2008 19:13:02 +0200 > schrieb "Peter Stibrany" <pstibrany at gmail.com>: > >> Hello, >> >> thank you for response. I was not able to get link_attrs working in >> webgen 0.5.3. I tried various syntax variations, but with no luck. >> >> But I solved my problem in other way. I simply added "htmltitle" >> metadata into my page: >> >> title: Short link title for menu >> htmltitle: Some long title used in HTML header >> >> and I use following snippet in my default.template: >> >> <% if node.meta_info.has_key?("htmltitle") %> >> <title>{htmltitle:}</title> >> <% else %> >> <title>{title:}</title> >> <% end %> > > Have a look at http://pastie.org/263598 . This shows a page file > that uses the link_attrs meta information. > > -- Thomas > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users >