Typo3: How to remove blank paragraphs on a page

I use Typo3 v6.1 to create a standard text page. In the view, Typo3 adds four blank paragraphs before and after the content created in the Rich Text Editor.

<p class="bodytext">&nbsp;</p>
<p class="bodytext">    <!--  CONTENT ELEMENT, uid:17/text [begin] --></p>
<p class="bodytext">        <a id="c17"></a></p>
<p class="bodytext">        <!--  Text: [begin] --></p>    

<p class="bodytext">The actual text added using the Rich Text Editor</p>    

<p class="bodytext">        <!--  Text: [end] --></p>
<p class="bodytext">&nbsp;</p>
<p class="bodytext">    <!--  CONTENT ELEMENT, uid:17/text [end] --></p>
<p class="bodytext">&nbsp;</p>  

It goes without saying that I would like to get rid of this mess, especially since they &nbsp;break the layout.

+4
source share
7 answers

There is parseFunc <lib.parseFunc_RTE in the wrong place.

It looks like you have something like

page.10 = CONTENT
page.10.stdWrap.parseFunc < lib.parseFunc_RTE

This would mean: make content, and then analyze that content with lib.parseFunc_RTE. The code that activates the wrap is

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.wrapNonWrappedLines = <p>|</p>

, , lib.parseFunc_RTE , bodytext, .

TypoScript .

:

TypoScript ( css_styled_content; )

page = PAGE
page.10 < styles.content.get

, p class= "bodytext" .

Update:

{content}, {content} styles.content.get f.e. parseFunc . styles.content.get parseFunc, . f: format.html lib.parseFunc . , .

# in this case, f:format.html does not need to execute the parseFunc again
<f:format.html  parseFuncTSPath="">{content}</f:format.html>

lib.parseFunc_RTE, RTE, lib.parseFunc, HTML- ( f.e.).

+8

script root

:

content.RTE_compliant = 0

:

tt_content.stdWrap.dataWrap >
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines>
+4

, .

<f:format.html>
   {field.copyrightText}
</f:format.html>

<f:format.html>{field.copyrightText}</f:format.html>

. , , , viewHelper.

, -;

+1

, . div "CSS Styled Content". content < styles.content.get, , Fluid, - RTE .

- ( ):

# standard enclosure for header
lib.stdheader.10.1.fontTag = <h1>|</h1>    

# remove .csc-header
lib.stdheader.stdWrap.dataWrap >    

# plain headings
lib.stdheader.2.headerStyle >
lib.stdheader.3.headerClass >    

# (unknown, german version read "remove other stuff"
tt_content.stdWrap.dataWrap =    

# disable .bodytext in RTE paragraphs
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.addAttributes.P.class >    

# disable paragraph-enclosure for these tags
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList = cite, div, p, pre, hr, h1, h2, h3, h4, h5, h6,table,tr,td    

# remove paragraphs in tables
#lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.removeTags = p    

# allow classes in tables
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.list >

: . ( , ), p .

0

, .

config.disablePrefixComment = 1
-1

May be fixed by removing lines / spaces inside the format.html tag

Wrong:

<f:format.html>{data_item.tx_mask_content_rte} </f:format.html>

Correctly <f:format.html>{data_item.tx_mask_content_rte}</f:format.html>

The same applies <f:format.date>where lines / spaces can lead to fatal errors.

Again badly copes with imho liquid.

Hope this helps

-1
source

Add this code above the body tag,

<script>
   var elems = document.getElementsByTagName('p');
   var elemsLenght = elems.length;
   for (var i = 0; i < elemsLenght; ++i) {
       if (elems[i].innerHTML == '' || elems[i].innerHTML == ' ' || >elems[i].innerHTML == '&nbsp;')
      { 
          elems[i].innerHTML="";
          elems[i].className="";
      }
    }
 </script>
-5
source

All Articles