CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • What is a jQuery snippet to open a closed accordion on page load?
Pages: [1]

Author Topic: What is a jQuery snippet to open a closed accordion on page load?  (Read 2190 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
What is a jQuery snippet to open a closed accordion on page load?
March 15, 2012, 01:55:14 pm
Specifically I want the "Filter by activity type"

Code: [Select]
<div class="crm-activity-selector-activity">
<div class="crm-accordion-wrapper crm-search_filters-accordion crm-accordion-closed crm-accordion-processed">

I found this page but the code example is vague and I can't get it to work in my instance.

http://wiki.civicrm.org/confluence/display/CRMDOC41/Accordions


Any ideas?  Thanks.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: What is a jQuery snippet to open a closed accordion on page load?
March 15, 2012, 06:54:21 pm
Quote
Specifically I want the "Filter by activity type"

Do you want this to be open by default on both dashlet and activity tab ?

Kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: What is a jQuery snippet to open a closed accordion on page load?
March 15, 2012, 09:06:27 pm
Yes please.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: What is a jQuery snippet to open a closed accordion on page load?
March 16, 2012, 03:38:43 pm
Found solution.

1. Create custom templates directory if you don't already have one
2. Create this file <custom_tpl_dir>/CRM/Activity/Page/Tab.extra.tpl
3. Place this code (nothing more) in file and save.
Code: [Select]
{literal}
<script>
cj(".crm-search_filters-accordion").removeClass('crm-accordion-closed').addClass('crm-accordion-open');
</script>
{literal}

Gracias to coleman for the assist.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: What is a jQuery snippet to open a closed accordion on page load?
March 16, 2012, 04:41:41 pm
I would slightly modify it:

Code: [Select]
{literal}
<script>
cj(function(){
    cj(".crm-search_filters-accordion").removeClass('crm-accordion-closed').addClass('crm-accordion-open');
});
</script>
{literal}

Kurund
« Last Edit: March 16, 2012, 11:27:37 pm by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: What is a jQuery snippet to open a closed accordion on page load?
March 16, 2012, 06:15:05 pm
Can we mount an argument for having this expanded by default- having it expanded takes up hardly any more space as having it closed and would save a fair amount of clicking it open each time.

In fact if the filter was on the same line as 'filter by activity type, it would be there an obvious to all concerned as a permanently available option.

Even better, if we had it on the same line as new activity, it would take up even less space ;-)

eg a line like this

CREATE NEW <activity type>         FILTER BY <activity type>
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: What is a jQuery snippet to open a closed accordion on page load?
March 19, 2012, 04:09:19 pm
We can add more filters to sort activities like status, date etc.. hence filter section was implemented in accordion style.

Kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: What is a jQuery snippet to open a closed accordion on page load?
March 28, 2012, 01:38:27 am
More filters?  Really? How?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: What is a jQuery snippet to open a closed accordion on page load?
March 29, 2012, 04:30:20 pm
Quote
More filters?  Really? How?

I meant someone needs to add the code to support more filters :)

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • What is a jQuery snippet to open a closed accordion on page load?

This forum was archived on 2017-11-26.