Tags:
create new tag
view all tags

Question

Hello,

after I installed the GenPDF addon, pdf creation worked via URL ( ...../twiki/bin/genpdf/XYZ), however it didn't work via customizing the SKIN variable in TWikiPreferences ( SKIN = genpdf, pattern) as it is suggested on the GenPDFAddOnDev page. Therefore I added a 'pdf-template' to topicactionbuttons.pattern.tmpl with the link to the genpdf script:

<a href='%SCRIPTURLPATH{"genpdf"}%/%WEB%/%TOPIC%?pdftitle=%TOPIC%'   ...>

and added a button to the first line of viewtoolbar.pattern.tmpl

%TMPL:P{"pdf"}%

Now at the top right of the window there is a 'PDF' button, but the 'Printable' button has disappeared. So I'm wondering what I could do to have these two buttons next to each other?

Regards, Felix

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux
Web server: Apache
Perl version: 5.8.4
Client OS: Linux
Web Browser: Firefox 2
Categories: Addons Templates

-- FelixDreher - 02 Oct 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

> I added a 'pdf-template' to topicactionbuttons.pattern.tmpl

Just checking, I assume you meant: viewtopicactionbuttons.pattern.tmpl

Perhaps you deleted the print line? What does your topicactionbuttons template definition look like now? [I find it easier to read when split like so, but don't do that in the template file, since the new line characters are preserved]:

%TMPL:DEF{"topicactionbuttons"}%
%TMPL:P{"action_activatable_edit_or_create"}%
%TMPL:P{"action_activatable_attach"}%
%TMPL:P{"action_printable"}%
%TMPL:P{"action_PDF"}%
%TMPL:P{"action_revisions"}%
%TMPL:P{"action_backlinks_simple"}%
%TMPL:P{"action_raw_or_view"}%
%TMPL:P{"action_activatable_raw_edit"}%
%TMPL:P{"activatable_more"}%
%TMPL:END%

And for the action PDF definition:

%TMPL:DEF{"PDF"}%<span><a href='%SCRIPTURLPATH{"genpdf"}%/%WEB%/%TOPIC%?pdftitle=%WEB%.%TOPIC%' rel='nofollow' %MAKETEXT{"title='PDF version of this topic' accesskey='d'>P&DF"}%</a></span>%TMPL:END%

-- SeanCMorgan - 02 Oct 2008

Hello Sean,

I just reviewed the viewtopicactionbuttons.pattern.tmpl file and compared it with the backup (original) version, and interestingly found quite a lot of differences that were not introduced by me via text editor (so - as I didn't work much with templates yet - I'm wondering if this file is changed dynamically by some TWiki functionality?). Anyway, I adjusted the lines concerning the 'printable' button, and now it works as expected.

Thank you + best regards, Felix

-- FelixDreher - 06 Oct 2008

by the way, what I did during my first attempt was: in viewtopicactionbuttons.pattern.tmpl, I only added the following line:

%TMPL:DEF{"pdf"}%<span class='patternButton'><a href='%SCRIPTURLPATH{"genpdf"}%/%WEB%/%TOPIC%?pdftitle=%TOPIC%' rel='nofollow' %MAKETEXT{"title='PDF version of this topic' accesskey='p'>&PDF"}%</a></span>%TMPL:END%

and in viewtoolbar.pattern.tmpl I added the TMPL:P{"pdf"}; the whole file now looks like this:

%TMPL:DEF{toolbar_buttons}%<div class="patternToolBarButtons">
%TMPL:P{"activatable_edit_or_create"}%
%TMPL:P{context="WysiwygPluginEnabled" then="activatable_edit_wysiwyg"}%
<span class="patternButton">
    %TMPL:P{"activatable_attach"}%
</span>
<span class="patternButton">
    %TMPL:P{"printable"}%
</span>
<span class="patternButton">
    %TMPL:P{"pdf"}%
</span>
</div>
%TMPL:END%

%TMPL:DEF{"toolbar"}%
<div class="patternTop">
<div class="patternToolBar">
%TMPL:P{"toolbar_buttons"}%
</div><!-- /patternToolBar-->
<div class="patternToolBarBottom"></div>
</div><!-- /patternTop-->%TMPL:END%

-- FelixDreher - 06 Oct 2008

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-10-06 - FelixDreher
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.