Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Faq/EM and STRONG

From TYPO3Wiki
Jump to: navigation, search

<< Back to FAQ

notice - This information is outdated


If you want to use relative (<em>, <strong>) instead of absolute (<i>, <b>) formatting in Typo3 up to version 3.7 you have to do that in Typoscript template (setup), like this:

lib.parseFunc_RTE.tags {
 b = TEXT
 b {
   current = 1
   wrap = <strong> | </strong>
   parseFunc {
     makelinks = 1
     makelinks.http.keep = path
     makelinks.http.extTarget = _blank
     makelinks.mailto.keep = path
     tags {
       link = TEXT
       link {
         current = 1
         typolink.extTarget = _blank
         typolink.parameter.data = parameters : allParams
       }
     }
   }
 }
 i < .b
 i.wrap =  | 
}

There seems to be no other way. It seems that the default transformations force b and i in the database. No way to get rid of this.

The workaround is also independent of the RTE. It's just an additional transformation at *rendering* time.

Alternative solution

This is another way of doing the same thing:

## b -> strong and i -> em ##

lib.parseFunc_RTE {

# rewrites the tags - but not in ul and ol...
  nonTypoTagStdWrap.HTMLparser = 1
  nonTypoTagStdWrap.HTMLparser {
     tags.b.remap = strong
     tags.i.remap = em
  }

# this adds the rewriting to ul and ol but now there are ps wrapped around li...
  externalBlocks {
     ul.callRecursive=1
     ul.callRecursive.tagStdWrap.HTMLparser = 1
     ol.callRecursive=1
     ol.callRecursive.tagStdWrap.HTMLparser = 1
  }
# no more ps araound li...
  nonTypoTagStdWrap.encapsLines.encapsTagList = div,p,pre,h1,h2,h3,h4,h5,h6,li
}