? Failure

User tests: Successful: Unsuccessful:

avatar C-Lodder
C-Lodder
9 Oct 2016

Pull Request in favour of #10932

Summary of Changes

This PR adds a preview button to the toolbar, which upon clicking, reveals a modal, showing the user a preview of the article in the frontend.

screeny1

Testing Instructions

  1. Apply PR
  2. Open an existing article (or create and save a new one)
  3. Click preview button
  4. Ensure the modal displays your site with a preview of the article

Documentation Changes Required

None

Note

I've put the function to get the URL in a new helper file rather than the view.html.php. Is this the correct approach?

avatar C-Lodder C-Lodder - open - 9 Oct 2016
avatar C-Lodder C-Lodder - change - 9 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Labels Added: ?
avatar C-Lodder C-Lodder - edited - 9 Oct 2016
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Category Administration Components
avatar C-Lodder C-Lodder - change - 9 Oct 2016
Title
Preview
Add article preview button to toolbar
avatar C-Lodder C-Lodder - change - 9 Oct 2016
Title
Preview
Add article preview button to toolbar
avatar ciar4n
ciar4n - comment - 9 Oct 2016

Nice!

On larger screens the article iframe appears to extend out beyond the modal box...

Edit: Not a screen size issue. Issue noted on windows in both Chrome and FF.

article-preview

avatar ciar4n
ciar4n - comment - 9 Oct 2016

Removing the max-height (400px) on the '.modal-body' appears to resolve the issue.

avatar ciar4n
ciar4n - comment - 9 Oct 2016

Only when the preview modal is closed and then opened again is the inline styling added (max-height: initial; overflow-y: initial;) and the preview appears correctly.

avatar dgt41
dgt41 - comment - 9 Oct 2016

@ciar4n it's way easier to just pass some parameters:

$type = 'Modal', $name = '', $text = '', $url = '', $width = 640, $height = 480, $top = 0, $left = 0,
        $onClose = '', $title = '', $footer = null

in this line

$bar->appendButton('Popup', $icon, 'Preview', $url . '&task=preview');
avatar Fedik
Fedik - comment - 9 Oct 2016

Feature is cool.

Maybe instead of modal use link with target="_blank" or target="joomla-article-preview"?
it will be more easy, and will work a lot better, especially on a small screens and mobile

avatar C-Lodder
C-Lodder - comment - 9 Oct 2016

Yup, could do a link opening a new tab if it's preferred. I don't care either way so you guys make up your mind and I'll implement whichever.

avatar ciar4n
ciar4n - comment - 9 Oct 2016

Personally I like the modal box however I think it should fill the screen. The reduced size in the current modal may trigger some media queries on responsive sites. Filling the screen would ensure an accurate representation of the article on the device it is been worked on.

avatar andrepereiradasilva
andrepereiradasilva - comment - 9 Oct 2016

IMHO you need to change the base branch to 3.7.x as it is a new feature

avatar C-Lodder C-Lodder - change - 23 Oct 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-10-23 18:00:55
Closed_By C-Lodder
avatar C-Lodder C-Lodder - close - 23 Oct 2016
avatar C-Lodder C-Lodder - close - 23 Oct 2016
avatar JoshuaLewis
JoshuaLewis - comment - 27 Oct 2016

Is there a continuation of this on the J 3.7 branch? A preview button would be pretty cool to see in the future of Joomla.


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

avatar C-Lodder
C-Lodder - comment - 28 Oct 2016

@JoshuaLewis I'm adding it to the J4 template repo

avatar JoshuaLewis
JoshuaLewis - comment - 28 Oct 2016

Too short of notice for J3.7? Or perhaps there is a code reason for this?

avatar infograf768
infograf768 - comment - 28 Oct 2016

Staging should be targeted now as 3.7 was merged in staging.

avatar C-Lodder
C-Lodder - comment - 28 Oct 2016

@JoshuaLewis - So that I don't wait on decisions and can just get stuff done :)

avatar JoshuaLewis
JoshuaLewis - comment - 28 Oct 2016

Fair enough. Well some would argue if that's fair, but I do trust that increasing the odds of this coming in is a good thing.

Add a Comment

Login with GitHub to post a comment