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 have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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:
Topic revision: r3 - 2008-10-06 - FelixDreher
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.