WYSIWYG Problem? Not sure

WYSIWYG Problem? Not sure

Gary Rodgers -
回帖数:6

This is a lot easier to explain if you could see our VLE:

http://www.vle.nabwoodschool.org.uk

You can see that the Art and Business Studies icons are to the left of thier given names, and Design Technology and Geography are nicely centered.  All the settings in each of the tables cells are exactly the same, the only difference between them is that the first two icons have a link embedded and the last two dont.  This took me all weekend to figure out what was causing this and it but i dont know why its happening. It appears that, in the editor, when i select an icon in the table and 'Insert Web link', save changes, the icon sets itself to the left.  No amount of centering / positioning makes any difference.  In the editor it does actually look fine, but at the front end the icon is to the left.  I was wondering if anyone else has had this problem.  I tried to upgrade to the latest Moodle release to see if there was a patch for it but no luck.  伤心   Any help would be greatly received, i have to show the 'new' VLE to our SLT in 1 weeks time  :-o

回复Gary Rodgers

Re: WYSIWYG Problem? Not sure

Mary Cooch -
Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Testers的头像 Translators的头像
Hi there from another UK secondary school Moodler smile It does seem odd as I've done similar before and don't recall having this issue - but - why not work round it by having your text link in a cell underneath so the image and text are separate? I've tried this on our year 6 section (top left of here) and it's not too bad, centring wise. Alternatively I suppose you could link to the words instead of the images? Though clicking on images is quite nice.
回复Mary Cooch

Re: WYSIWYG Problem? Not sure

Gary Rodgers -

I have tried linking the text instead and that too floats to the left when linked.

Itamar, yeah i did try the Justify Center icon but still the same.  I`m gonna have ago at the fix you suggested. I`ll let you know, thanks for your help!

回复Gary Rodgers

Re: WYSIWYG Problem? Not sure

Itamar Tzadok -
On your site (in my browser) it looks like what you describe. But if I copy the label content and paste into a label on my site, all the icons are centered. This suggests a theme issue and I see that you use piranah. So to begin with, try applying a standard theme and see if it fixes the problem. It should be good to know the oddities (relative to your expectations) of your preferred theme. Next, have you tried centering the icon in the editor? If not, edit the label select the icon and center it (center ) and see if that works. 微笑

Added:

I've just had another look and this is definitely a theme issue. The piranah theme defines the <a> tag in an activity in a section (which is your link) to float to the left and that overrides the centering you apply to the cell. You should see that once you link the other two icons they too will float to the left of their cells. If you can and want to tweak the theme it's in

http://vle.nabwoodschool.org.uk/theme/piranah/styles.php

line 1077

.section .activity a
{
float:left;
padding:3px;
vertical-align:top;
}

and you should delete the float attribute.

If you don't tweak the theme and try instead centering the icon as I suggested above this may not work if the editor applies the rule to the icon, but will work if it applies the rule to the wrapping link. So, if it doesn't work you can still do that manually by switching to html mode and adding to the a tag 'style="float:center" :

<a href="http://vle.nabwoodschool.org.uk/course/vle.nabwoodschool.org.uk/course/category.php?id=5" style="float:center"><img hspace="0" height="50" border="0" width="50" src="http://vle.nabwoodschool.org.uk/file.php/1/art.png" alt="Art" title="Art"></a>

hth 微笑
回复Itamar Tzadok

Re: WYSIWYG Problem? Not sure

Gary Rodgers -
OK, i tried adding style="float:center", but when i toggle back to wysiwyg then back to html mode again it doesnt save, so subsequently the icon still floats left.  Now going to try removing the attribute in the styles.php
回复Gary Rodgers

Re: WYSIWYG Problem? Not sure

Itamar Tzadok -
True. My miss. 'center' is not a valid value of float and that's why the editor strips it out. It should be

style="float:none;"

Bear in mind that there might be a reason for that float definition in the theme and removing it may have some unexpected effects (unless of course you always expect the unexpected). 微笑
回复Itamar Tzadok

Re: WYSIWYG Problem? Not sure

Gary Rodgers -

Hmmm, for some reason i cant find the float:left attribute in the styles.php file (i copied the file to my local machine to work on it)  in fact there is very little on in this file, yet when navigated to in a brower (vle.nabwoodschool.org.uk/theme/piranah/styles.php) i can see it there.

May time to try another theme me thinks.