Hello Manuel,

Thank you very much for this module. It's absolutely awesome! :)

Is there a way to include not only the field style but also node style display?
I thought it could use the node title as header and wrap the node content into the accordion body.

I'm not familiar with views so my feature request may be naive to you. If so, forgive me please. :)
Normally I use fields for my accordion views but this time I really need a node style display because the photos album does not integrate with views and I cannot show the slideshow other than via node style display.

Kind regards,
Stefan

Comments

manuel garcia’s picture

You can already get what you want with fields row style by using:
1. Node: Title.
2. Node: body or Node: teaser

As the fields added. This should get you the same. I haven't supported the node row style because I don't think there's much use here, but if other people request it I might think about it.

design.er’s picture

Manuel, thank you for your reply.
Usually your suggestion is absolutely correct. I already use it and it works fine for me.
But this time I have to generate a view with all photos nodes added to the current group.
The problem is that photos adds a slideshow to the node but not inside the body but beneath it so I can't call it directly through the body field. It's sad but true.
That's why I thought it would make sense to handle it this way:
"Node: title" as accordion header and the rest of the node as accordion body.

Please feel free to tell me a better way if you know one. :) Otherwise a node view solution would be awesome.
There are also other scenarios where a node view support make sense instead of workarounds with fields -> a view with different node types where not every node type has the same fields and that's why no output so views has to render empty (already styled) fields with height margins etc. That's neither performance-friendly nor nice.
But this is an other scenario. :)

I really thank you for all your work on this module. I really love it! :)

Rock on!
Stefan

manuel garcia’s picture

Category: support » feature
Status: Active » Postponed

No time atm to tackle this, I probably would need a day at least for implementing and testing it with most options so things wouldn't break.

On a sidenote, that module photos looks a bit scary, doesn't seem to be integrating with the rest of the drupal-sphere, looks like it tries to do everything itself. Not sure I would use it myself, you might want to try out other alternatives in the mean time, up to you of course ;)

design.er’s picture

Thank you very much for your sidenote. I'm looking for an other media module - maybe I should try the new SSP Integration.
Yes, I believe that it would take a lot of time to implement and test this feature.
Anyways, I think it would be awesome to have a node view display for this module in the future - independent of the photos module and not in the next days, of course.
Please let me know if I can help you to test this feature.

Offtopic: I hope to get one of my current projects online in about 1 month where Views Accordion is one of the most important style modules to display summarized podcasts, galleries and contents in stylish ways. Unfortunately it's in German but nevertheless maybe you are interested to see the results or use it for reference of your nice module.

Kind regards,
Stefan

manuel garcia’s picture

Sure, drop the link in here once it's live =)

About choosing an alternative module, you may want to checkout these two links:

manuel garcia’s picture

Status: Postponed » Needs review
StatusFileSize
new5.43 KB

OK, I had some time to look into this.

I'm attaching a patch that gets this done, with the garland theme. This is not ready for production, unless your node.tpl file outputs the titles as h2, and well, if your nodes don't have any more h2's in them.

The problem with this feature request, is that views cannot affect how your node rows are printed out. This is handled by the theme itself, and people can, and usually do, alter the way their nodes are printed. So I have no consistent way of selecting the titles to form the accordions. This is why I think this feature won't make it in, unless someone provides some insight into the problem.

The patch is made against the latest development version. I have made a new commit (http://drupal.org/cvs?commit=275608) fixing a small issue before this, so wait for the tarball to appear with today's date before downloading the dev version and testing this patch.

design.er’s picture

Hi Manuel,

Thanks a lot for your work. I really appreciate it. :)
I'll take time and test your patch (hopefully already tonight).

Yes, you're absolutely right. I think it's not possible for views accordion to get sure the used node provides the required node field formatting and it's not its task (IMO). Users who want to use this feature should fit the requirements for styles and formats. There are also requirements for the field style display and users are willing to provide them so I think it will be OK in this case too. Maybe there will be a better way to handle this in the future but for now it should sufficient.

Again, thank you and will report back asap. :)

design.er’s picture

Hi Manuel,

I tested the new patch and hey, it's awesome!!! :)) It works absolutely fine. I tested the scenario with overridden node-type.tpl.php files: It breaks when no node-div and h2 tag is provided as you said.

Do you want - if possible - to override the styling of the h2 tag? At the moment it is really big and contains a link to the node. For me this is not that problem, I can override this in my styles.css and node-type.tpl.php but I try to think more generic for other people without enough skills to do this or who don't want to override the h2 link in the node.tpl.php.

Thank you for your work. It's great to see it in action. :)

manuel garcia’s picture

Status: Needs review » Needs work

Thanks for testing it design.er =)

Yup, the problem is that unless we figure out how to make views_accordion take control of that html for node row styles, this patch is not going to make it in. I make a pledge to support the code I provide, and it would be impossible to support this, since a lot of themes out there do things differently in their node tpl files.

So for now, the status is needs work. Perhaps mr. chaos can enlighten us a bit on this, or someone else, but for now it's not ready to be committed.

alexpott’s picture

StatusFileSize
new5.02 KB

Got a different approach to this issue here which allows views_accordion to add its own node titles and put them in its own html. Then the developer can hide the title on the actual node anyway they like (use CSS or edit its .tpl.php file)

The only reservation I have about this patch is that for accordions on node row style views it introduces a dependency on views 2.7 as some of the code from views_plugin_style render() has to go back into views_accordion so that the node titles can be loaded up and used as groupings.

Thanks for a useful module.

design.er’s picture

Hi Alex,

Thank you very much for your work. It sounds interesting.
Unfortunately, I didn't have time to test the patch yet. Just for my understanding. Do I have to write a static title for every node or does it work with tokens or views/node $variables -> (token) [title-raw], (views) [title] or (node) $node->title?

Regards,
Stefan

alexpott’s picture

It'll just use whatever you've set the node's title to. There's no settings for this in the view it would be controlled from the node. If you want to use tokens in your node titles you can use http://drupal.org/project/auto_nodetitle

design.er’s picture

No, that's cool as it is. I only wanted to know how it works. :)
Thank you! :)

design.er’s picture

So, I found time to test the patch from #10. It seems to work fine so far. I couldn't notice any bugs.
I'm not sure why but there was no styling -> everything was just white - no borders, no colors as we know them from this module. Am I missing something or is it normal?

alexpott’s picture

There's an option in the views_accordian options to use your own styling or the modules. Maybe you have it set to not use the default view accordian styles? Is the css from the accordian module being loaded?

hefox’s picture

Haven't tested the patch, but on the whole title thing: panels introduces a way to suppress the title for nodes it includes. They do that by unsetting $node->title and let the theme respond to that.

edit: patch works :)

lejon’s picture

Did this make it into the latest release? I can't see it in the release notes.

lejon’s picture

sorry, i should explain that the reason for this is that i want to use views accordian as the view for the Faceted Search module, but that only accepts displays with a node rather than field view.

Thanks!

design.er’s picture

No, you have to patch the module. It works great for me if I use the right <hx>-tag in my templates. I can't remember if it was <h2> or <h3> - you simply have to take a look into the code to find out.

Here are two examples of what I did with it: http://www.lifestylechurch.de/icf.html and http://www.lifestylechurch.de/media/podcasts.html

cheers
stefan

lejon’s picture

can I request that this patch go into the next release? Would open up a lot of use-applications with views-accordian.

Thanks!

manuel garcia’s picture

The patch on comment #10 re-introduces the render function code. This is unnecessary, and actually led to a problem when views changed its code, and was removed, see commit #283544 and the issue #621568: Views 2.7 breaks views accordion.

If you are curious about why this hasn't gone in, and probably won't, do read my comment and patch on comment #6

So unless a super hero figures out a clean way to go about it, which will not fill this module's issue queue with tons of support requests and bug reports, this is NOT going in any release. If you feel you could perhaps figure it out, do read comment #6 first.

hefox’s picture

To solve this, made a module that makes a view field that displays the node (http://drupal.org/project/viewsnodefield ). Uses views themeing, so should be able to add a specific node-view.tpl.php to remove the title if so desired. Currently, can see it "in action" here http://foxinbox.org/drupal/modules

There does seem to be some issue with the selectors adding the accoridian class too much when there's a view attached to the node (like via views attach module)

manuel garcia’s picture

Status: Needs work » Closed (won't fix)

I'm sorry but this opens up too much trouble.

design.er’s picture

Oh, oh, my view with node style accordion is broken since I've upgraded to View 2.10.
Is there no way to get this up & running? I really need this. :(