Login
Main menu

Pragmatism in code

Michael Percy AKA DeeEmm - Waxing lyrical about life the universe and everything software related since lunchtime 2006.

Fixing the paragraph spacing issue

by in Dolphin 7.0.x Modifications
  • Font size: Larger Smaller
  • Hits: 3291
  • Subscribe to this entry
  • Print
3291

You may have noticed that after neatly setting out your post within the TinyMCE editor, when the page is published, the paragraphs are all squashed up.

The issue is a CSS issue. Basically the style applied to the P tag by TinyMCE and D7 are different - so it displays OK in the editor, but when the D7 code renders it - it is displayed differently.

The offending code is in templates/base/css/general.css, the attribute margin:0px is applied to the P tag, remove this and the issue will be gone, BUT there is one caveat - obviously this affects ALL instances of the P tag - so it may be that whilst this cures the immediate issue, it may cause problems elsewhere (i've not tested this, and this may be different for your site - depending on which template you use and what modifications you have applied to them)

To fix the issue, you will need to change general.css in two places -

Line 1

Change

 

a img, form, p

 

to

a img, form

and on line 120

change

p
{
margin:0px;
padding:0px;
}

to

p
{
padding:0px;
}

There is no real need to apply the attributes to the P as has been done in the original code, plus declaring the base P tag in two different places can lead to inheritance issues.

If it turns out that removing these elements has too much of a knock on effect on other areas of the site, then The best solution may be to alter the TinyMCE css to match the D7 general by adding the margin:0px to plugins/tiny_mce/themes/advanced/skins/default/content.css At least then what you see will actually be what you get

Add comment

Search