Can you think of any way to open a specified accordion row by clicking on a remote link.
My idea is to provide a submenu in my sidebar, that refers to the accordion displayed on the page. When you click on a link, one row should open, that you have specified in the link URL or somewhere else...
Any idea?
Thanks. Nice module!

Comments

manuel garcia’s picture

This module will not provide such functionality sorry...

Puting things on a sidebar that affect the content on the node being displayed will either have to be done through custom jQuery you write yourself, or perhaps just go with one of the few views tabs modules that are out there, though none will put things on the sidebar though.

You may want to check this for other options, test things out, and decide =)

manuel garcia’s picture

Status: Active » Fixed

Assuming my response solved your question, due to lack of response.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

khalor’s picture

Version: 6.x-1.2-beta3 » 6.x-1.x-dev
Category: support » feature
Status: Closed (fixed) » Active

Re-opening as I think you may have misunderstood the original poster somewhat - doesn't sound like it's anything to do with pushing content to a node. It's a general feature request that I also would like to see:

Can rows in Views Accordion be opened via anchor links (either in the current page or elsewhere)? eg

<a href="#row1">Open Row 1</a>

Presumably there'd need to be some kind of naming convention as to how the anchors are named (based on the title field content? row number?)
jQuery UI's Accordion widget (http://jqueryui.com/demos/accordion/) optionally implements this, haven't looked under the hood yet as to how.

FL4PJ4CK’s picture

I'd realy like to see a feature like this, too.
I already added anchors to my accrodion view and can jump to them, but it's quite confusing for the user that the content doesn't show up then.

http://www.dev.mountainboard-world.de/glossar

Under the headline "Übersicht" you can see some anchor links so that you can see what I mean.

ssm2017 Binder’s picture

subscribing

mattez’s picture

+1

walden’s picture

+1

quartertonecreative’s picture

I'd love to see this also... have had quite a few sites wanting this and so far have had no luck implementing. Fingers crossed someone smarter than me knows a way :)

cholden’s picture

I'm looking forward to a solution for this as well.

tiger_h’s picture

subscribing

manuel garcia’s picture

Status: Active » Closed (won't fix)

I'm sorry people, but with d7 around the corner, this module's 6.x branch has gone into bug fixing mode only.

Good news is that the 7.x branch is using core's jquery ui accordion, which supports this feature.

xaa’s picture

ehi,
could be very great if someone can develop this option for d6 :)

CatherineOmega’s picture

Manuel, would you be at all opposed to someone else backporting those aforementioned D7 changes?

manuel garcia’s picture

CatherineOmega, xaa, views_accordion in D7 is a very different module than in d6. It uses jQuery UI accordion plug in, which allows for deep linking to have a certain row opened on page load. It doesn't allow for clicking somewhere else and opening the accordion item without a page load. There is nothing to be backported or developed for d6.

All you need to do in your own project is to code some jQuery to get this effect, and it really shouldn't be that hard for someone that knows js.

grasmash’s picture

Using a little custom code and adding a few items to your view will accomplish this.

Create your view

-add this header with input filter "php code":

<?php
  $view = views_get_current_view();
  $nid_arg = $view-> args[0];
?>
<?php if ($nid_arg): ?>
<div id="nid-argument"><?php print $nid_arg; ?></div>
<?php endif; ?>

-add a 'Global NULL' argument to the view.

-add the field 'Node: NID'. Rewrite the output of this field to be:

<a class="accordion-nid" name="accordion-nid-[nid]" id="accordion-nid-[nid]"></a>

If using views 3, I'd recommend setting all html wrapper, label, and html element settings to 'none'.

Add jQuery code to custom js script

-this can really be added anywhere as long as it's loaded on the view page

//open views accordion drawer based on GET argument
if ( $('#nid-argument') != ''){   
  vacc_nid = $('#nid-argument').html();    
  $('#accordion-nid-'+vacc_nid).parent().siblings('.accordion-header').trigger("click");
  $('html, body').animate({ scrollTop: $('#accordion-nid-'+vacc_nid).parent().siblings('.accordion-header').offset().top }, 500);

}

finally, add this css to hide the helper elements:

#nid-argument, .accordion-nid {
  display: none;
}

Now when you navigate to the URL my-view-path/[nid], it will open the accordion drawer with [nid].

It's messy, but it works, and it's not very resource intensive.

ilyasmdgh’s picture