By Anonymous (not verified) on
Please tell me how to use views snippets, or direct me to the documentation. I've searched, but to no avail.
Thanks,
Doug Gough
Please tell me how to use views snippets, or direct me to the documentation. I've searched, but to no avail.
Thanks,
Doug Gough
Comments
In the handbooks
In the handbooks at http://drupal.org/node/47412
www.justapickle.com
blogging community for the socially conscious
www.slickfish.com.au
professional, affordable web site design, production and maintenance for small business
Where do I paste the php view snippets?
Unfortunately, the handbook doesn't seem to tell me what to do with the php code. I know how to import a view, but I have no idea where to paste the php view snippets.
in adming >> views click on
in adming >> views click on the import tab.
copy everything between the
<?php> ...... ?>tags. Save. Add any associated template.php file to your theme if directed by the instructions.-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
after import...nothing
Thanks for the quick reply. Somehow it never crossed my mind to simply import the php code. However, when I am at the import interface, the instructions read:
You may import a view by cut-and-pasting the results of an export view. If the import is successful you will be taken to the Add View page with all of the settings of the imported view..
When I attempt to import the following code (found at http://drupal.org/node/42605 ), I dont' get sent to the Add View page. Perhaps it's not a view snippet?
If this is not a veiws snippet, what is it? I'm looking for a way to use views to build a menu system with expandable submenues, like the standard drupal menu module does. Perhaps I'm coming at this ALL WRONG :-)
Thanks,
Doug Gough
It's function declaration
Duh...I haven't thought about programming for a while, so I kind of missed the fact that is just a function declaration. So the question is, where do I put this, and how do I call it?
This is a views theme function
Again...Duh...I'm reading the documentation now :-)
Recently went through
Recently went through similier curve myself so I'm with you there. :D
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Still lost
I just don't really get it. What do I do with this code? (from http://drupal.org/node/42606)
This version is supposed to create a menu from a veiw. I put it in the template.php file, and changed VIEWNAME to menuview (the name of my view) but I get this error:
warning: Invalid argument supplied for foreach() in D:\web\paportal\themes\paportalnew\template.php on line 34.
I've read through the documentation but I just don't get how to make this snippet work. Since I'm generating an error, I guess that means that something is actually calling the function, which I'm thankful for. This snippet is different enough from the stuff in the handbook to confuse an inexperienced coder like myself.
Thanks,
Doug Gough