• Resolved tjesker

    (@tjesker)


    I would like to use the Collapse-O-Matic plugin with short code like below for each of 4 events held on the same day so that people can expand/collapse the complete descriptions for each:

    [expand title="Read more..." swaptitle="Read less..."]Text I want to go here[/expand]

    I’ve placed the above short code in each of the event descriptions but the tags area ignored and the page seems to be locked into only displaying excerpts.

    Under Events->Settings->Formatting->Events I only see where I can control excerpts for each event description. How can I display the complete description for each event and use the short code above to expand/collapse the the details of each event?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • I am not part of support… just some dude..
    I have used collapse-o-matic a bunch.. the plugin owner is a super helpful guy.

    below is a working.. example with Events Manger. It will give you an idea.. of some coding.

    <table>
    <tbody>
    <tr>
    <td>
    <ul>
    <ul>[events_list_grouped mode="monthly" country="US"]</ul>
    </ul>
    <p>[expand title="#_CATEGORYIMAGE #_EVENTNAME" startwrap="<strong>" endwrap="</strong>" tag="div style='background-color:#ffff00;width:450px;border:1px solid;'"]</p>
    <div style="border: 1px solid; width: 450px; solid;padding: 0px; background-color: #ccffff;">#_EVENTDATES at #_EVENTTIMES #_LOCATIONNAME<br /> #_EVENTEXCERPT{20,...}#_EVENTLINK</div>
    <p>[/expand]</p>
    <p>[/events_list_grouped]</p>
    </td>
    </tr>
    </tbody>
    </table>

    Make sure you put the code in with the “Text” editor.. NOT Visual editor.
    AND !!! if you switch back and forth between Text and Visual it will mess up the code.
    It’s the <ul> statements that get messed up.

    If my code above doesn’t work it’s probably your settings in Collapse-O-Matic.

    Post your Collapes-O-Matic code and I’ll take a look.
    Collapse-O-Matic has tons of little tricks to do just about what ever you want.
    You have to get familiar with the documentation.. he has tons of examples out there.

    In the long run this is a Collapse-O-Matic question… but my example will help you with EM placeholders and get you going.

    Also.. in Collapse-O-Matic -> Settings.. for my example make sure you have…
    Tag Attribute put in div (it’s the second or so from the top).

    and also below that..
    Targtag Attribute: do the same

    • This reply was modified 6 years, 11 months ago by Robswaimea.
    • This reply was modified 6 years, 11 months ago by Robswaimea.

    also you can put the above code in a test page or post..
    You don’t have to put it in the Events Manager Settings.

    Here is a “cleaner” version similar to the above…

    <ul >[events_list_grouped mode="monthly" country="US"]
    <p>[expand title="#_CATEGORYIMAGE #_EVENTNAME" startwrap="<strong><li>" endwrap="</strong>" tag="div"]</p>
    <div >#_EVENTDATES at #_EVENTTIMES #_LOCATIONNAME<br />#_EVENTEXCERPT{20,...}#_EVENTLINK </div>
    <p>[/expand]</p>
    <p>[/events_list_grouped]</p>
    </ul>

    Don’t forget.. Collapse-O-Matic -> Settings.. for my example make sure you have…
    Tag Attribute put in div (it’s the second or so from the top).

    and also below that..
    Targtag Attribute: do the same

    • This reply was modified 6 years, 11 months ago by Robswaimea.

    ok… with this post.. we are getting away from Events Manager.. so you should probably get over to Collapse O Matic for further instructions.
    In CoM you can enter html statements but you need to escape them as you see below.
    Also in CoM you can’t use double quotes in the [expand] statement for html.. use the single which you will also see below in the html statements.

    Hopefully there isn’t a jquery conflict causing the initial problem with other plugins..
    But EM and CoM are very compatible.

    <div>
    <ul>[events_list]
    [expand title="%(%span style='background-color: #ffff00;'%)%%(%strong style='color: #000000;'%)%#_CATEGORYIMAGE #D #d #M  #_EVENTNAME%(%/strong%)%%(%/span%)% %(%br /%)%%(%span style='background-color: #00ffff;'%)%%(%strong style='color: #000000;'%)% #_LOCATIONNAME%(%/strong%)% %(%/span%)%%(%br /%)%#_EVENTDATES at #_EVENTTIMES" tag="div" targclass="maptastic" rel="wompwomp-highlander"]
    <div style="background-color: #ccffff;">#_EVENTDATES at #_EVENTTIMES<br />
    #_LOCATIONNAME<br />
    #_EVENTEXCERPT{100,...}<br />
    <span style="font-size: 14pt; font-weight: bold;"><a href="#_EVENTURL">Read more....</a></span></div>
    [/expand]
    [/events_list]
    </ul>
    </div>
    • This reply was modified 6 years, 11 months ago by Robswaimea.
    • This reply was modified 6 years, 11 months ago by Robswaimea.
    Thread Starter tjesker

    (@tjesker)

    Robswaimea thanks VERY much for all of the great examples – they will definitely be helpful!

    I pasted in your last example here https://www.blackburncle.com/classes/test-of-more/ and while I can see I need to read up on the Collapse-O-Matic settings, my main concern is … “How can I get the expanded text to show on the same page and not go to a new page like it does now when you click Read More?”

    (My theme was already inserting “Read More” buttons below each event here https://www.blackburncle.com/events/2018-01-19/ and then I hid them with CSS (they are showing again now) and I got Collapse-O-Matic hoping to get the expanded text to stay on the same page).

    Go over to CoM plugin… and post a support question there.

    I retested my code… so it is a plugin/theme conflict, or your settings in CoM. I looked at your page.. I didn’t see any jquery errors .
    In CoM there are options to load the scripts in header or footer, try changing that.

    We should continue this over at CoM. I will visit there to help with CoM, as the plugin author will most likely check in.

    Put this simpler code in your test page (it was above) to eliminate so it looks cleaner..

    <ul >[events_list_grouped mode="monthly" country="US"]
    <p>[expand title="#_CATEGORYIMAGE #_EVENTNAME" startwrap="<strong>" endwrap="</strong>" tag="div"]</p>
    <div >#_EVENTDATES at #_EVENTTIMES #_LOCATIONNAME<br />#_EVENTEXCERPT{20,...}#_EVENTLINK </div>
    <p>[/expand]</p>
    <p>[/events_list_grouped]</p>
    </ul>

    Thanks.. and of course the dreaded “try a WP default theme.. deactivate other plugins”

    • This reply was modified 6 years, 11 months ago by Robswaimea.
    • This reply was modified 6 years, 11 months ago by Robswaimea.
    Thread Starter tjesker

    (@tjesker)

    I figured it out! I read up on how excerpts work at these two links…

    https://codex.www.ads-software.com/Excerpt
    https://developer.www.ads-software.com/reference/functions/the_excerpt/

    …and then did a grep search of the theme files for “the_excerpt” to locate the template file that was inserting the excerpts. I figured out that the theme had a custom function called “thim_excerpt” that uses “get_the_excerpt()” so next I searched for “thim_excerpt” and found several occurrences. So I inserted some dummy text and kept loading the page until I found the occurrence that was inserting the excerpt I wanted to change – which ended up being in theme_name/content.php.

    Next I copied content.php to my child theme folder theme_name_child/content.php and commented out the line that has “the_excerpt()” and inserted echo the_content(); below it. (I could have made the change to the original theme file without copying content.php to the child theme folder but my changes would get overwritten the next time there is a theme update).

    Now the entire text of all of the events for that day display along with the booking forms for each.

    Finally I used the Collapse-O-Matic plugin to show/hide part/all of the description for each event and show/hide the booking form for each. e.g.

    In the event editor:
    excerpt text[expand title="Read more..." swaptitle="Read less..."] Rest of text [/expand]

    Under Settings->Formats–>Events->Single Event Page:
    [expand title="Sign Up" trigclass="noarrow"]#_BOOKINGFORM etc.[/expand]

    • This reply was modified 6 years, 10 months ago by tjesker.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How can I display complete event descriptions & expand/collapse details?’ is closed to new replies.