Custom CSS in print view

More
13 years 3 weeks ago #20078 by igcorreia
Is there any possibility of changing the PRINT template?
I have asked in the past to add a custom suffix for a category template now we nee to customize the print template.

How can I add a custom CSS ou a SUFFIX to the print view.

From what I am noticing it is not possible, becouse it is reading the core template, rigth?
pop=1&tmpl=component

Any ideas?

Consider adding a suffix per template for the print view.

Please Log in or Create an account to join the conversation.

More
13 years 3 weeks ago #20084 by ggppdk
Replied by ggppdk on topic Custom CSS in print view
Actually it is very easy to customize the print output,

just do this inside your template files
Code:
if ( JRequest::getVar('print') ) { ... // anything you }
e.g. inside your template file: item.php
do:
Code:
if ( JRequest::getVar('print') ) { $document->addStyleSheet('item_print.css'); ... // anything you }

With a similar if (or negative if) you can choose not to print some position, or anything else you want, by placing this if anywhere in the code.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #20119 by igcorreia
Replied by igcorreia on topic Custom CSS in print view
I see so I want to add 2 images 1 before the content and 1 after the content in the category view so the user can print all the filtered jobs.

So in the desired template / CATEGORY.php i need to add
one IF before <!-- BOF buttons --> and another IF after <!-- EOF pagination --> , correct?

This is what I am trying and it is not working:
Code:
<!-- BOF LOGO for print --> <?php //only show this part in the print view if ( JRequest::getVar('print') ) { <span>The image should be here!</span> } endif; ?> <!-- EOF LOGO for print -->

It is not working, what am I doing wrong?

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #20121 by igcorreia
Replied by igcorreia on topic Custom CSS in print view
I give up, it blows up FC.

I cant seem to ge it work, inotice my code was not correct but I steal cant seem to find a way to add the logo on the print view.

Could you help me.

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #20122 by ggppdk
Replied by ggppdk on topic Custom CSS in print view
This is very strange,
1. You add the logo with html <img> tag or with some box that has the logo as background?
2. If you do "view page source" do you see the img tag or the box?
3. Does the src parameter of the img tag have correct path? or does the box with background have correct path for the background image?

Tell me the folder of the image and paste here the if code that insert the img tag or box.

I don't think there is some FLEXIcontent bug here.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #20126 by igcorreia
Replied by igcorreia on topic Custom CSS in print view
1. You add the logo with html <img> tag or with some box that has the logo as background?
--The problem with CSS is that it is not printable, the background images are not printed, so I have to put the images in side <img> tags.

2. If you do "view page source" do you see the img tag or the box?
--The problem is that the way my code is written is not correct.

3. Does the src parameter of the img tag have correct path? or does the box with background have correct path for the background image?
--The path was correct but I tried with "text" and it also didn't work.

----
This were my tries:
1 - Based on your proposal
Code:
<!-- BOF LOGO for print --> <?php //only show this part in the print view if ( JRequest::getVar('print') ) { <span>The image should be here!</span> } endif; ?> <!-- EOF LOGO for print -->

2 - Based on some example from FC code
Code:
<!-- BOF LOGO for print --> <?php if ( JRequest::getVar('print') ) : ?> <span>The image should be here!</span> <?php endif; ?> <!-- EOF LOGO for print -->

3 - Tried to use the TITLE
Code:
<!-- BOF LOGO for print --> <?php if ( JRequest::getVar('print') ) : ?> <?php echo $this->params->get('page_title'); ?> <?php endif; ?> <!-- EOF LOGO for print -->

None of them worked. If I manage to get regular TEXT to work then I can customize as I want the <img> that I need.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.422 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline