Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image placement should replicate actual position in TinyMCE #2202

Closed
robbieaverill opened this issue Jun 26, 2018 · 6 comments
Closed

Image placement should replicate actual position in TinyMCE #2202

robbieaverill opened this issue Jun 26, 2018 · 6 comments

Comments

@robbieaverill
Copy link
Contributor

@clarkepaul commented on Tue Jun 19 2018

For CWP themes the CMS doesn't detect the position of image alignment, so there is a disconnect between the preview and whats displayed in TinyMCE.

image

Image provided during CMS training.

@robbieaverill
Copy link
Contributor Author

robbieaverill commented Jun 26, 2018

Initially raised as a CWP bug, I've replicated this on the CMS demo site (running 4.1.0).

Notes:

  • Images that have a "center" alignment chosen when inserting them from files are correctly centered on the frontend
  • Images that are center aligned via WYSIWYG button for test are not center aligned correctly in the frontend
  • WYSIWYG center aligns images by applying margin-left/margin-right: auto style definitions to them which get lost when saving the page

image

@lukereative lukereative self-assigned this Aug 9, 2018
@lukereative
Copy link
Contributor

lukereative commented Aug 9, 2018

@robbieaverill I can't seem to replicate this on a fresh 4.1.0 install with cwp-starter + watea. My images get the center class applied appropriately and the result is displayed correctly. Somewhat related to this was silverstripe/silverstripe-asset-admin#801 which now correctly shows what alignment an image has when editing image properties via TinyMCE, but this doesn't seem to be what the issue is here.

@lukereative
Copy link
Contributor

lukereative commented Aug 26, 2018

@robbieaverill is there any clarification you can give on this?

@robbieaverill
Copy link
Contributor Author

robbieaverill commented Aug 26, 2018

@lukereative insert an image, click on it, click "Center" in the WYSIWYG alignment options - see it's not honoured.

I think you're right in that silverstripe/silverstripe-asset-admin#801 has resolved the bug when aligning via the dropdown in the image details modal - that looks like it's working now.

I'm testing this on demo.silverstripe.org FYI

image

@lukereative
Copy link
Contributor

@robbieaverill Oh I get you now, I didn't realise those buttons controlled image position. I thought they were for text only – it seems a bit broken that they insert inline styles separate to using the alignment classes that the file dialogue uses. I guess changing these buttons to instead use those 'right', 'left', 'centre' classes is the correct fix.

@robbieaverill
Copy link
Contributor Author

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

No branches or pull requests

2 participants