Drupal theming consulting- Panels and Views questions
Hi Benjamin,
Looking forward to talking tomorrow. I do have some questions ready so I'm inserting them below. I suspect we won't get everything covered in 30 minutes so if you do have time to extend to an hour that might be a good idea. I can pay ahead of time if you wish.
Just note on the context around these questions - my self-training on Drupal theming so far comes from very little experience putting together a Drupal site from the 'front end'. I have been 'reverse engineering' another site that someone asked me to theme. Unfortunately I didn't have access to the developers who created the site so I couldn't ask them questions about how they had designed and structured the site. This meant many, many hours of tracing through code to see what was going on. Of course I did refer to whatever documentation I could find at Drupal.org (and google often brought me to your site) and I've read through most of the Pro Drupal Development book and the Theming for Drupal 5 book.
Tracing through code is perhaps not the best way to learn a CMS framework like Drupal but I certainly have a good sense of what's inside the black box now. What I'm missing is perhaps the big picture elements that might nomally get resolved if one takes front end first approach. So these are the questions that loomed largest for me:
====================================================================
Panels:
Are panels the standard way of doing layout? Are they necessary? What is their value over other CSS layout definitions? Is it just 'quick and dirty' layout?
If we use them, how do we precisely customize the values for the layout dimensions?
If we don't use them then how do we control what is displayed on the page?
Is there a setting in admin to turn off the size and placement properties? If so then why use panels at all?
Style Plugins:
What are they used for?
Where are they defined?
Query Modification:
For the display of nodes in a given view I want to display different things depending on the value of node_type. In views_build_view(), this property is not retrieved from the database and so does not get passed back via the 'node' object to my theme functions. I can add it to the View in the admin settings but then I have to filter out the display of the node_type value in the theme function. Or perhaps I can just modify the query and pull it back from the db.
If I do modify the query do that still result in the additional property (node_type) having its valuedisplayed in the view? In other words, what exactly determines what is display in the view? Is it just derived from whatever node properties are retrieved from the db or is there another form of 'display list' somewhere?
views_build_view() has a call to look for modules that implement 'views_pre_query'
How do modules use this? What kinds of modules? Do I have to build my own module when all I'm trying to do is control how a view looks? (This is perhaps a broad question about how modules are used.)
What is hook_views_query_substitutions used for?
Front (Front Page) Module:
The project I've been looking at uses the 'front' module to control the content on the front page. It uses variables (i.e. in the $variables array) to set certain text and the links but I cannot find where those variables are set. Would this be done through admin? If so where? Or is it through code and where would that code be defined?
====================================================================
Thanks!
Michael
Hi Michael,
Quick questions back: Panels 1 or 2 and if 1 can you switch to Panels 2?
Generally you'll want to do Views theming (which we do a lot) rather than a custom module to change the way a view looks.
There are always multiple ways to do things in Drupal and many, many available tools-- discussion of tools and ways to do things in the abstract can go on infinitely. The best approach is to define what one needs to do as concretely as possible, and then decide the best approach for that particular need, and learn by doing.
So if you can bring concrete needs to the table I think you'll get the most out of this.
talk to you tomorrow,
benjamin
Agaric Design Collective
Open Source Free Software Web Development
http://agaricdesign.com/
Miscellaneous comments
Styles plugins: I don't even know what these are, unless they're that thing I implemented once for defining a whole new view field.
Views query modification: it seems that views arguments should be able to do all that's wanted here. It will depend exactly what will be wanted here.
Comments
Post new comment