CMS Made Simple Forums
https://forum.cmsmadesimple.org/

[module] StartExpandCollapse
https://forum.cmsmadesimple.org/viewtopic.php?f=75&t=56929
Page 1 of 1

Author:  janvl [ Thu Sep 22, 2011 10:07 pm ]
Post subject:  [module] StartExpandCollapse

Hi,

this is just a question.

I have just installed the module "comment" on 19.4.3 and saw that it uses the tags StartExpandCollapse and StopExpandCollapse.

In 1.10 they are removed. One can expect problems with more modules I guess. Is there already an alternative and/or workaround?

I know it is not core but with beta 3 one can start thinking about things like that.

Kind regards,
Jan

Author:  calguy1000 [ Thu Sep 22, 2011 10:14 pm ]
Post subject:  Re: StartExpandCollapse

With jQuery being shipped with CMSMS there is no need to include tags for expandCollapse..

it's as trivial as (something like:)
{cms_jquery} {* in the header *}

EDIT: I fixed a problem I saw in my typing but still haven't tested this.
\$1:
<__script__ type="text/javascript">{literal}
$(document).ready(function){
  $('.toggle').click(function(){
     var rel = $(this).attr('rel')
     $('.area').hide();
     $('#'+rel).show();
  });
});
{/literal}</__script>


<div class="toggle" rel="box1">expand a</div>
<div class="area" id="box1">abcdefg</div>
<div class="toggle" rel="box2">expand b</div>
<div class="area" id="box2">foo bar</div>

Author:  janvl [ Thu Sep 22, 2011 10:20 pm ]
Post subject:  Re: StartExpandCollapse

Thank you !

Kind regards,
Jan

Author:  JeremyBASS [ Fri Sep 23, 2011 1:33 am ]
Post subject:  Re: StartExpandCollapse

Passing by and I wanted to point out two things here, first there is .slideToggle() in jquery which can be used, but there is a bouns with the new {cmsms_jquery}. You load the the jQuery UI lib with the default tag, so this is all you need :D (note: I like using the cdn)

\$1:
<__html><head>
{cms_jquery cdn=true} {* in the header *}
<__script__ type="text/javascript">{literal}

   $(function() {
      $( "#accordion" ).accordion({
         collapsible: true
      });
   });

{/literal}</__script>
</head></__body>

<div id="accordion">
    <h3><a href="#">First header</a></h3>
    <div>First content</div>
    <h3><a href="#">Second header</a></h3>
    <div>Second content</div>
</div>

<__body></__html>


so really there is alot of power for sure :D

Just thought I'd share. Have fun..
Cheers -Jeremy

Author:  Rolf [ Fri Sep 23, 2011 1:20 pm ]
Post subject:  Re: StartExpandCollapse

janvl \janvl:
In 1.10 they are removed. One can expect problems with more modules I guess.
It won't break excisting websites, because during an upgrade no files are deleted!

grtz. Rolf

Author:  calguy1000 [ Fri Sep 23, 2011 2:59 pm ]
Post subject:  Re: StartExpandCollapse

Your best bet is to contact the author to make sure that he makes the appropriate changes.

I would expect it's as simple as a template change anyways.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/