Rather than having the current setup of text being added in variables in a closed function in the module, can we have a theme function so we can override the text in the print pages? I can't work this out myself easily to apply a patch unfortunately though...

Comments

jcnventura’s picture

Status: Active » Fixed

This is actually been done already, but not yet in the 'official' release.

You can now theme the print_format_link, which enables you to change the contents of the link array. To replace the link text, replace the 'text' field with whatever you want.

NikLP’s picture

I was thinking more of the other stuff, like "By !user" etc. "By" shouldn't really be capitalised, and other than that, we ought to be able to override all this stuff. Anything that outputs text or markup should really be themable, although I don't want to be too patronising :)

jcnventura’s picture

OK. Sorry for the misunderstanding...

As to your request, my suggestion is to use the super-theming capability which involves placing a copy of the print.tpl.php file in your current theme folder. You can then do whatever you want with the layout and content of the print output page (including removing or replacing the text provided by the default functionality). Would this suit your purposes?

I actually removed the 'By' from the template file a while ago, as I wanted that file to be very simple and easy to edit. I could move back there the 'By', 'Created', 'retrieved on' and 'Published on', but that would clutter the file and I guess most people who don't like the text usually prefer to completely remove the line.

Regards,

João

NikLP’s picture

I have used the facility of the template file; however, my point really relates to the fact that you are creating the "theme" variables in a function, and those variables contain text. It would be better if the variables were created in a function of their own (no text) and then returned from a separate theming function that could contain all the non-generated text. Alternatively, you could just remove the text from the variables altogether and print the text in the template, but that would mean they couldn't be translated by t().

In the way that I'm describing, the level of flexibility is dramatically increased, and no-one needs to install translation modules to change the text :)

Thanks for sticking with me on this :)

jcnventura’s picture

Status: Fixed » Postponed

I see your point.. I think I can do this in the next version (I have just released 5.x-3.1, so it will probably be 5.x-3.2).

jcnventura’s picture

Status: Postponed » Fixed

Ok.

I have just added a function called theme_print_text which you can costumize to change the string via the theme.

I tested it and it is OK for me, but tell me if there's any problem.

João

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

haggins’s picture

Version: 5.x-3.0 » 6.x-1.x-dev
Status: Closed (fixed) » Active

mytheme_print_text() doesn't do anything at my template.php
I also can't find this function defined at any of the modules files. Could you describe a little more precise how to change the variables values for print.tpl.php or even how to add additional vars?

Thanks in advance.

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

The theme_print_text() function was removed in 6.x-1.0 (December 2008), in favor of letting the users change that text in the settings UI.

haggins’s picture

So there is no chance to add any information (i.e. context) to print.tpl.php?
It's a pity :(

jcnventura’s picture

Well the print.tpl.php file is a PHP file, you can do anything there.. You have access to the node object in $node..

I don't really understand what you mean with "context".

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No further info in more than two weeks. Closing the issue.