Hi, On pdfreaders.org, the footer is entered as a separate section in every .page- file. Ideally, we''d like to have the footer, with all translations, in a separate file instead. The correct footer should then be fetched automatically, according to a priority list (i.e. if the Swedish footer is missing it fetches the Norwegian one, rather than the English one). Is this possible? all the best, /Stian
> On pdfreaders.org, the footer is entered as a separate section in > every .page- file. > > Ideally, we''d like to have the footer, with all translations, in a > separate file instead. > > The correct footer should then be fetched automatically, according to > a priority list (i.e. if the Swedish footer is missing it fetches the > Norwegian one, rather than the English one). > > Is this possible?Certainly. I assume you have the following or a similar layout: src/ src/default.template src/footer.en.template src/footer.de.template src/footer.nb.template src/index.de.page src/index.en.page src/index.sv.page One src/footer.??.template file for each language you have. Then you can put the following into your src/default.template where the footer should be included: <% languages = case context.content_node.lang when ''de'' then [''de''] when ''en'' then [''en''] when ''sv'' then [''sv'', ''nb''] when ''nb'' then [''nb''] end used_node = languages.map {|l| context.content_node.tree["/footer.#{l}.template"]}.compact.first if used_node %> <webgen:block name="content" chain="<%= used_node.absolute_lcn %>" /> <% end %> The result is that the english footer is used in the english index page, the german footer in the german index page and the norwegian (nb) footer in the swedish index page. The only thing you have to adjust now are the preferences for each language (in the case statement of the ERB code). Let me know if you need further help! -- Thomas
From Thomas Leitner, 2009-03-13: [...]> The result is that the english footer is used in the english index > page, the german footer in the german index page and the norwegian (nb) > footer in the swedish index page. > > The only thing you have to adjust now are the preferences for each > language (in the case statement of the ERB code).Thanks Thomas! This is just what we were looking for. all the best, /Stian