Let’s say you have some content that you would like hidden until someon clicks on it, then the content is displayed.

Like this.

To create this, all we need to do is add the Generico plugin to Moodle.

First, install the Generico filter.

https://moodle.org/plugins/filter_generico

After installing you will need to enable the Generico filter. You can enable the Generico filter at:

Site Administration -> plugins -> filters -> manage filters

Once you have the Generico filter installed you will need to go to templates and create a new template.

Site Administration -> plugins -> filters -> Generico > Templates

Select an empty template number from the list of templates.  

Complete the following settings for the new Template

 

  1. Enter the text ‘clicktoview’ in lower case.
  2. Enter a name for the template ‘Click to View’ will be ok.
  3. Enter a version number (for your reference)
  4. Type in the code below for the instructions
{GENERICO:type="clicktoview",title="Test Title!"}
Some content (HTML is allowed)
{GENERICO:type="clicktoview_end"}
  1. Copy in the code for the Body of the template
  2. Type </div> into the End Tags template area
  3. Type title= into the variable defaults panel
<div class="collapsed ctv-header" role="button" data-toggle="collapse" href="#@@AUTOID@@" aria-expanded="false"> 
 <i class="fa fa-arrow-right"></i> @@title@@</div>
  <div class="ctv-content collapse" id="@@AUTOID@@" aria-expanded="false">
  1. Copy the code below into the Custom CSS
.ctv-header
{
background: #efeded;
padding:5px;
cursor:pointer
}
.ctv-content
{
padding:20px !important;
background: #fefefe;
padding:5px;
border:1px solid #eee;
}
Go to your Moodle course

Create a new page.

Paste in the text below (as text) into the page.

You can add any content that you like between the Generico tags including images, embedded videos and text.

{GENERICO:type="clicktoview",title="Test Title!"}

Some content (HTML is allowed)

{GENERICO:type="clicktoview_end"}
If you now view your page, you can test the Click to show bar to view the hidden content.
You can also go back and edit the CSS to make any necessary changes to the Click to View button by editing the template.

Would you like a FREE copy of the Top 10 Admin Tasks​ that you ​must know​ for Moodle Administrators?
You will discover some simple things that you can do in Moodle that will make your life easier.