Jump to content

How to make read more option with CSS in TinyMCE (homepage editor)


zdeneklogin

Recommended Posts

I use this code for "read more" option (see bellow), it works perfectly in different eshop system

But it does not work in prestashop text editor. Text is not unrolled. I have already extended tinymce to rich editor. 

 

How to change tinymce configuration code ?

 

HTML
<input type="checkbox" class="unpack" id="box" />
<div class="unpack"><label for="box"></label>
 <div class="hiden-text">hello world hello world hello world</div>
 
CSS
input.unpack {display: none;}
input[type=checkbox]:checked + .unpack .hiden-text {display: block}
.unpack > .hiden-text {display: none}
 
 
.unpack > label {
  display: block; cursor: pointer; background:#f5f5f5; color: #f5f5f5; padding: .5em
}
input[type=checkbox]:checked + .unpack label {background: #f5f5f5;}
 
.unpack > label:before {
  content: "read more"; background: #f5f5f5; color: red; padding: 0 .3em; margin-right: .5em; border-radius: 3px
}
input[type=checkbox]:checked + .unpack label:before {content: "close text"; color: red; font-weight: strong; font-size: 14px}
 
 
Link to comment
Share on other sites

I put this code (through "source code" button)

 

 <input type="checkbox" class="unpack" id="box" />

<div class="unpack"><label for="box"></label>
<div class="hiden-text">hello world hello world hello world</div>
 
But I see only "read more" link and nothing happens after click
Link to comment
Share on other sites

this is css solution, you do not need any js,

 

as I wrote in my first post = first part of code ("hmtl") I put to the editor a second part ("CSS") to CSS

 

This method works perfectly in other editors what I use... so there have to be some bad setting in tinymce configuration code

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...