Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.11
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2010 at 06:52 UTC
Updated:
30 Nov 2010 at 21:00 UTC
I'm wondering if the result of a view can be unthemed, without all the crazy HTML around it. Never really understood why the View module forces themes on a view.
I've mainly worked with CodeIgniter before, so I assumed the Views module was similar to the CodeIgniter concept of views.
Is there a way to get rid of all the themeing and just have the result from the view as a plain text output so I can use it as an argument for my other views? Perhaps the result from a view can be stored in an array?
thanx
-Frank
Comments
Comment #1
webbernet commentedalso is there perhaps another module that will do this?
I wouldn't mind if I could insert my own custom queries somewhere and have the results that way.
Comment #2
merlinofchaos commentedWords like crazy and forces are combative and inflammatory. They don't really create an environment where people really want to answer your question.
In general, if your use case is that you don't want all that ugly theming, I recommend you skip Views and just write your queries and do what you want to do with it. The debates and complaints about Views' markup are old history, in the past, and we've made our decisions and have moved on.
The actual answer to your question is that yes, you can get an array from Views, and it's even in the API documentation, so I suggest you read that first.
Comment #3
webbernet commentedthanx for the reply. but I think you are taking those words out of context.
I did read the Views API, and didn't find a function that let me return the results as an array...
I'll hunt a bit deeper. but right now I'm using strip_tags() to get rid of the HTML, which is not an ideal solution.
Comment #4
merlinofchaos commentedGoogle will probably lead you to what you want faster. There are some articles on the topic people have written that are easier to find than the documentation, since this is not exactly a feature everyone wants right away and so isn't in the immediately available docs.