Hey there,
I would like to insert a couple of views as droplets on my Mysite install. The thing is that I created a new "format" plugin for all mysite content that I use for the rest of the content. That new format is an ajax preview pop up box that shows a list of titles and an ajax pop up box when the user clicks on a title, instead of going to the node directly.
To keep the look consistent on all content blocks I would love to format the views droplets in the same fomat than the rest of the content... Do you think this is a realistic feature request?
Thanks,
Patchak
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | preview.theme_.txt | 1.98 KB | patchak |
Comments
Comment #1
agentrickardI do not understand the request. How are the views droplets different so that your format cannot be applied?
I need more detail to answer.
Can you attach the format plugin file here?
Comment #2
patchak commentedHey there,
Well the views droplets seems to be displayed in their native views format, for example table, list or teaser list. My own custom format is a list block, and when you click on a link it pop up a window with the teaser info in it.
SO I would love to be able to make custom list views and display them with that custom format on the mysite page.
Hope this is clearer, here is attached the format in question. (rename it to .theme to use it.)
Comment #3
agentrickardI'm looking at the code and guessing that your issue is this part:
The $element['content'] is already formatted by the native Views handler. I think retheming the view itself, using Views Theme Wizard, is your best approach.
Also remember that you are not required to use
theme('mysite_droplet', $element['content'])here. You could use a different theme function.The question from my end, I think, is "do you need more information about the View in order to make a theme selection?"
Comment #4
patchak commentedSo it's not possible to override the views theme with a mysite theme without actually retheming the view? What would be nice is to only be able to tell mysite to override this view's theme with a selected format only when the view is presented in a mysite page.
ps. have you tried the new format I attached? do you like it?
Comment #5
agentrickardI get it. You would need more information about the View passed to the format layer.
The key may be in this function in droplet.inc:
The question is: How does
view_build_view()behave, and what additional arguments could you pass to it?I have not tried the new format yet.
Comment #6
patchak commentedHi, could you give me more details on what you mean? Sorry for being dense, but I'm not sure how I could theme the view separately for mysite and for the normal view,
thanks,
Patchak
Comment #7
agentrickardI am not sure either. I think it would be possible to pass a variable in the $args array in the function call:
At the end of views_build_view() is the following code:
You may be able to do what you need by implementing either a
mytheme_views_pre_view($view, $items)function or amytheme_views_post_view($view, $items, $output)function.A small module would be required, and you would want to check the following condition:
I am not certain that this will work unless the $view is passed by reference, and that does not appear to be the case.
You might also be able to override the default theme using the above conditional.
Comment #8
agentrickardI finally looked at the new format file, and it seems to rely on other files that are not present.
Especially lines like these:
Also a little change to this function in the API:
Comment #9
agentrickard