Tuesday, July 14, 2009

Custom Paragraph Classes in Typo3 RTE

Sometimes it is important to apply custom classes to paragraphs in RTE. Typo3 allows you to customize the "Block style" list easily. All it takes is a few lines of Typo Script in page TSconfig.

Let's add class lead for leading paragraph. We want this class to appear as "Leading paragraph" and be indicated with slightly bigger font on the "Block style" list. Here is how to do it in page TSconfig:
RTE {
classes.lead {
name = Leading paragraph
value = font-size:1.4em;
}

default {
contentCSS = fileadmin/templates/css/rte.css
proc.allowedClasses = lead
classesParagraph = lead
}
}
A few words of explanation:
  1. RTE.default.contentCSS defines css file used by RTE to render text in the editing window. It is required that the class we want to add is defined in this file
  2. RTE.classes.lead defines the entry for the "Block style" list; the value is inline style used to preview the class in the drop-down
  3. RTE.default.proc.allowedClasses tells RTE not to strip these classes when saving content to the database
  4. RTE.default.classesParagraph associates given class with paragraph, so you can see the selector on the "Block style" list when you choose "Paragraph" from the "Type of block" drop-down.
Further details (and much more) you can find in the page TSconfing documentation.

70 comments:

  1. hi friend, There is small change needed in your above code to get it work correctly. ie
    proc.allowedClasses = lead
    classesParagraph = lead

    must be changed to

    proc.allowedClasses := addToList(lead)
    classesParagraph := addToList(lead)

    ReplyDelete
  2. I tried both versions but I can't choose the class in the dropdown box in the editor. Actually it doesn't appear at all. Could you please, help me out?

    ReplyDelete
  3. Hi hostilites of miit, you are absolutely correct. In my example the list gets overwritten and you have presented the unobtrusive way of adding element to the list.

    Thanks a lot,
    Jacek

    ReplyDelete
  4. Hi Laura, have you added the class to the css file? It's a bit tricky because otherwise it doesn't show up in the dropdown.

    ReplyDelete
  5. Hey Laura,

    Thanks for sharing valuable information, Great stuff and excellent jobs.

    Typo3 Customization Services

    ReplyDelete
  6. Hello Laura,

    Great stuff, I love to read your article frequently its really nice stuff. keep it up to continue posting.

    Typo3 Customization India

    ReplyDelete
  7. hi
    thanks for sharing this information is great and good job.
    typo3 customization

    ReplyDelete
  8. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Typo3, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Typo3. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com


    ReplyDelete
  9. This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolite festivity to pity. I appreciated what you ok extremely here.
    Java training in Marathahalli | Java training in Btm layout

    Java training in Marathahalli | Java training in Btm layout

    ReplyDelete
  10. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

    Data Science course in Chennai | Data science course in bangalore

    Data science course in pune | Data science online course

    Data Science Interview questions and answers

    ReplyDelete
  11. Wonderful Blog post, great article that you have provided for peoples. Its really good. Nice information.


    ExcelR Data Science Course in Bangalore

    ReplyDelete
  12. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
    data analytics certification courses in Bangalore
    ExcelR Data science courses in Bangalore

    ReplyDelete
  13. Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share.

    Big Data Course

    ReplyDelete
  14. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.
    AI learning course malaysia

    ReplyDelete
  15. Nice Post! Thank you for sharing knowledge, it was very good post to update my knowledge and improve my skills. keep blogging.
    Java Training in Electronic City

    ReplyDelete
  16. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page digital marketing course in singapore

    ReplyDelete
  17. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    Data Science Courses

    ReplyDelete

  18. Thanks for writing this great article. I’ve been using some of these techniques on by blog. But I didn’t know the phrase “Social Proof”. Thanks for sharing.
    One data science
    One Machine Learning

    ReplyDelete
  19. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    data science course malaysia

    ReplyDelete
  20. I really like it whenever people get together and share thoughts. Great website, stick with it!

    ReplyDelete
  21. Attend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses.
    ExcelR Data Science Courses
    Data Science Interview Questions

    ReplyDelete
  22. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.

    Digital marketing course

    ReplyDelete

  23. Thanks for sharing blog. The explanation of your articles is very good. It was very interesting and meaningful. I really appreciate it! Keep updating stuffs like this.
    Machine Learning Training In Hyderabad

    ReplyDelete
  24. Nice blog, I understood the topic very clearly, and want to study more like this.
    Data Science Training In Hyderabad

    ReplyDelete
  25. Excellent blog with lots of information, keep sharing. I am waiting for your more posts like this or related to any other informative topic.Amazing web journal I visit this blog it's extremely marvelous. Interestingly, in this blog content composed plainly and reasonable. The substance of data is educational Data Science Training In Chennai | Certification | Data Science Courses in Chennai | Data Science Training In Bangalore | Certification | Data Science Courses in Bangalore | Data Science Training In Hyderabad | Certification | Data Science Courses in hyderabad | Data Science Training In Coimbatore | Certification | Data Science Courses in Coimbatore | Data Science Training | Certification | Data Science Online Training Course

    ReplyDelete
  26. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

    AI Training in Hyderabad

    ReplyDelete
  27. ExcelR provides data scientist course in pune . It is a great platform for those who want to learn and become a data scientist. Students are tutored by professionals who have a degree in a particular topic. It is a great opportunity to learn and grow.

    data scientist course in pune

    ReplyDelete
  28. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work Data Analyst Course

    ReplyDelete
  29. Free Download IDM Full Crack saves time and increases server and internet speed. Professional software with balance.
    IDM Crack Key

    ReplyDelete
  30. Through this blog post, I gained a lot of knowledge about how to start my career in data science and data analytics. The course program offered by 360DigiTMG will help you to learn real-world applications of business analytics and data science. The field of data science is rapidly evolving, and this article has helped me how to keep pace with the competition.data analyst course in hyderabad

    ReplyDelete