You are here: Home / Documentation / How To's / How to make an easy slider collection show the body text

How to make an easy slider collection show the body text

by ledwell published Aug 09, 2013 02:00 PM, last modified Aug 16, 2016 10:50 AM
Sometimes you want to have your users choose "easy_slider" from the display menu on a collection and also have the body text from the collection display. Heres how you do it.

easy slider

You will need to have access to the zmi. So do the following

  1. log in
  2. browse to the zmi of your site
  3. choose the "portal_view_customization"
  4. select the "sliderview" from under the "collective.easyslider.interfaces.IViewEasySlider" heading
  5. choose "Customize"
  6. find this bit of code
<metal:body define-macro="folderlisting_macro">
 <tal:subtopics condition="here/hasSubtopics|nothing"
                define="folderContents here/getFolderContents">
   <h2 i18n:domain="atcontenttypes"
     Also in this section
   <metal:list metal:use-macro="here/base/macros/folderlisting"/>

add this part "above" that. 

<!-- Adds body text to slider-->
<div metal:define-macro="text-field-view"
             id="parent-fieldname-text" class="stx"
             tal:define="has_text exists:context/getText;
                         text python:has_text and here.getText() or ''"
             tal:attributes="class python:here.Format() in ('text/structured', 'text/x-rst', ) and 'stx' or 'plain'">
            <div metal:define-slot="inside" tal:replace="structure text">The body</div>
<!-- End of body text -->


Save your document

You should now see the body text of the collection that uses the "Easy Slider" view.


Every collection on your site that uses that view will show the body text below the slider part. If you don't want that then Id suggest creating a new view and registering it with the collection portal_type so your users will have 2 display options to choose from.