Skip to content

Conversation

@brianteeman
Copy link
Contributor

The option to email a link to a friend and to print an article were outdated when joomla 1.0 was launched - there are far better ways to share content etc.

A quick unscientific test of live sites showed none that were using this

This pr removes the show print and email icons options and code

If I understand everything correctly nothing would need to be done to update upgrading sites databases as the stored param would simply be ignored

The option to email a link to a friend and to print an article were outdated when joomla 1.0 was launched - there are far better ways to share content etc.

A quick unscientific test of live sites showed none that were using this

This pr removes the show print and email icons options and code

If I understand everything correctly nothing would need to be done to update upgrading sites databases as the stored param would simply be ignored
@C-Lodder
Copy link
Member

C-Lodder commented Jan 17, 2018

+1

This would fix #19221 I suppose

@rdeutz
Copy link
Contributor

rdeutz commented Jan 17, 2018

email ok, but the print function is not bad

@C-Lodder
Copy link
Member

@rdeutz - browsers have their own print functionality.

@rdeutz
Copy link
Contributor

rdeutz commented Jan 17, 2018

@C-Lodder I know but it works different

@ghost
Copy link

ghost commented Jan 17, 2018

I have tested this item ✅ successfully on 3ff030f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19393.

@brianteeman
Copy link
Contributor Author

  1. browsers have their own print
  2. print doesnt work on mobile
  3. print.css will let you customise the print view in a much better way

@rdeutz
Copy link
Contributor

rdeutz commented Jan 17, 2018

That is something I have to explain to a client, at least I know that one of my clients will miss the button.

@C-Lodder
Copy link
Member

@rdeutz But then again, you also have to explain to new clients that Joomla has a print feature and how to access it.

@brianteeman
Copy link
Contributor Author

If this was a proposal to add a print button it would be rejected on the basis that its something that the majority of site owners would not want

@rdeutz
Copy link
Contributor

rdeutz commented Jan 17, 2018

I can disable the feature for new clients, but anyway do whatever you think is right. I have told my opinion

@astridx
Copy link
Contributor

astridx commented Jan 17, 2018

I have tested this item ✅ successfully on 97c99cb
I also made a new installation, as database data are changed. This was OK, too.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19393.

@brianteeman
Copy link
Contributor Author

thanks for testing

JGLOBAL_OTPMETHOD_NONE="Disable Two Factor Authentication"
JGLOBAL_PASSWORD="Password"
JGLOBAL_PASSWORD_RESET_REQUIRED="You are required to reset your password before proceeding."
JGLOBAL_PRINT="Print"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this as it may be used elsewhere as I have done with many generic strings in the global language files

</div>
<?php endif; ?>
<?php if ($canEdit) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove 'print' => false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops ;)

Also need to check other views. Task for tomorrow

@infograf768
Copy link
Member

There is a big difference between printing via the browser and the Print article feature.
Printing via the browser will print the whole page.
Your Modules_article.pdf
Your Modules.pdf

I agree with @rdeutz
Let's keep the Print article.

@ciar4n
Copy link
Contributor

ciar4n commented Feb 15, 2018

@infograf768 Currently there is a big difference as there is no print specific CSS in the template. It is quite possible to make both of your examples look the same with the appropriate print specific styling.

@C-Lodder
Copy link
Member

@infograf768 That's why we mave @media print { ... }

@C-Lodder
Copy link
Member

C-Lodder commented Feb 15, 2018

If we want to just print an article or any content within the component area, then the following CSS can be used:

@media print {
    .container-header,
    .container-top-a,
    .container-top-b,
    .container-sidebar-left,
    .container-sidebar-right,
    .container-bottom-a,
    .container-bottom-b,
    .container-footer {
        display: none !important;
    }
}

@infograf768
Copy link
Member

This means that there is no choice on one hand between printing the whole page if the user wants to and a single article if the admin desires (after adding this css).

On the other hand, if a blog is displayed and there is no link to the specific article to force it to display alone, the result of such css is to print here 3 pages, 1st one blank, 2nd one with what ever gets into the pdf (it may be one or multiple articles) , 3rd one blank.

Here is the result printing as PDF

screen shot 2018-02-15 at 12 31 01

@mbabker
Copy link
Contributor

mbabker commented Feb 15, 2018

Personal attacks removed. JM we know quite well that you would prefer nothing changes, especially if Brian is the one who opened the PR. You do not need to use personal attacks and insults every time. Same goes for everyone else who likes to commonly trash other people's work.

All that is being done is removing core support for creating these buttons. If you want them, create a layout override that generates a link to the current page with this query string: ?tmpl=component&print=1 and you have your "pretty" page that is suitable for print. Not that difficult if it's a capability you really want on your sites.

@infograf768
Copy link
Member

Apparently you did not like
use Joomla\CMS\MiltonFriedman\ChicagoBoys\PrintNoHelper;

I can understand that. Sense of humor depends on different cultures. 😸 And it has nothing to do with who created the PR, but to the fact that this functionnality is real useful.
You will remark that I said nothing about mail to a friend as I do think it is a good idea to get rid of that one.

@mbabker
Copy link
Contributor

mbabker commented Feb 15, 2018

We aren't dropping the functionality in full though, that's the main point my comment was making. All we're removing is support for the JHtml helper that builds a button with the appropriate link (current page URI plus the query string I noted). If we were making it impossible to use the functionality I'd say something different, but really, this is so easily duplicated if you really need it I don't see why it needs to be a big concern.

@dgrammatiko
Copy link
Contributor

but to the fact that this functionnality is real useful

Those facts are very subjective. The only objective thing here is that the CMS delivers a page to the browser. The browser is responsible for the printing not the CMS. Please let's not use practices from last century.

Also what @mbabker said above

@brianteeman
Copy link
Contributor Author

That wasn't the offensive line as you well know - but nice try. Accept the PR and move into the 21st Century or stay in the dark ages. I am losing interest in Joomla very rapidly

@brianteeman brianteeman closed this Apr 3, 2018
@rdeutz rdeutz reopened this Apr 3, 2018
@infograf768
Copy link
Member

infograf768 commented Apr 4, 2018

The various proposals above (either the one from @C-Lodder or @mbabker )to print a specific article content did not work here except if the article is displayed alone in an otherwise empty page.
To solve the issue, the only way I found was to load a supplementary script (either in the article if one can or in all concerned overrides).

<script>
		function printDiv(divName){
			var printContents = document.getElementById(divName).innerHTML;
			var originalContents = document.body.innerHTML;
			document.body.innerHTML = printContents;
			window.print();
			document.body.innerHTML = originalContents;
		}
	</script>

and then add in the article

<div class="pull-right">
<button class="button btn btn-primary" onclick="printDiv('printarea')">Print only div below</button>
</div>
<div id='printarea'>

<p>The content of the article</p>

</div>

Which is impossible to do directly when using a WYSIWYG editor without a specific extension to enter js .
With this code I can print in staging , but it does not work in 4.0..... IN 4.0 I get the print dialog allright, but not the full div to print.

screen shot 2018-04-04 at 11 27 53

It's a real pity to be forced to use such "century-old practice" "in the 21st century".

One would say it is "normal" for a man using this kind of smartphone...
200px-fullerphone_1918

@mbabker
Copy link
Contributor

mbabker commented Apr 4, 2018

If adding a tmpl=component query string is not working in the 4.0 branch then there is a bug to be addressed. It is not indicative that core is not supporting this at all anymore.

@infograf768
Copy link
Member

@mbabker
I have no idea how to use this code to print the content of the article and only the content of the article, whatever the way the article is displayed, i.e. alone, in blog or as featured.

@mbabker
Copy link
Contributor

mbabker commented Apr 5, 2018

The "print URL" for the 3.8.6 release article is https://www.joomla.org/announcements/release-news/5725-joomla-3-8-6-release.html?tmpl=component

Similar to that, you need your link to have that tmpl=component query string in the request (the current helper generating the print button does exactly this). In your layout overrides, there are a couple of ways to accomplish this.

Probably the easiest:

$printUrl = clone JUri::current();
$printUrl->setVar('tmpl', 'component');

// When building your link, include 'echo $printUrl' to print the URL

@brianteeman
Copy link
Contributor Author

@wilsonge can I have a yes/no/partial on this please and I will redo the pr

  1. close
  2. Accept removal of print and email
  3. Accept removal of email only

@infograf768
Copy link
Member

Reminder to @wilsonge
None of the solutions proposed above did work to print a single article displayed in a blog or as featured when we have other articles displayed.

@brianteeman
Copy link
Contributor Author

@infograf768 of course number 3 does - thats why it is there

@rdeutz
Copy link
Contributor

rdeutz commented Aug 18, 2018

for the test can you make a PR against this Repo https://github.com/joomla/test-integration files are in the 4.0-dev branch /legacy and remove the files from your PR here, thanks

@joomla-cms-bot joomla-cms-bot changed the title [4.0] Remove article print and email [4.0] Remove article print and email Aug 18, 2018
@brianteeman
Copy link
Contributor Author

@rdeutz So now we have a chicken and egg scenario

A new pr for the tests in the tests repo should only be merged if this PR is accepted
But this pr wont be accepted without working tests

@wilsonge
Copy link
Contributor

I'm totally happy to remove print - this has been superseded by print stylesheets on pretty much all modern websites (and you'd use that to disable most the module positions in Joomla). I'm unsure as to whether we should remove the email functionality. Probably yes. But not 100%

@brianteeman
Copy link
Contributor Author

Can someone make a decision 100% then so I only have to write/update this once please

@dgrammatiko
Copy link
Contributor

this has been superseded by print stylesheets on pretty much all modern websites (and you'd use that to disable most the module positions in Joomla)

Just to add to what @wilsonge wrote above, there is a great css just for that: https://github.com/BafS/Gutenberg

@brianteeman
Copy link
Contributor Author

Closed - obviously there is no interest in this

@dgrammatiko
Copy link
Contributor

Thanks for reopening this!

@brianteeman
Copy link
Contributor Author

I am going to resubmit it as this is over 12 months old and a pain to resolve the conflicts.

@brianteeman
Copy link
Contributor Author

See #24025 for up to date PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.