Pragmatism in Code

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

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that has been used in the blog.
  • Login
Posted by on in Dolphin 7.0.x Modifications
  • Font size: Larger Smaller
  • Hits: 1859
  • 0 Comments
  • Print

Fixing the paragraph spacing issue

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

Rate this blog entry:
0
DeeEmm AKA Michael Percy is an industrial software engineer specialising in language based programming. A long time supporter and contributor to the open source community, he can mostly be found tinkering about creating web sites and plugins for various CMS platforms as well as maintaining several websites of his own.
  • No comments found
Add comment