Hi - it would be useful for me to have a popup for a whole node's details to display when the mouse is hovered over a table element that's a CCK field of a node.
e.g.
Table View list of nodes
-----------------
node1_title cck_field_value_1
node2_title cck_field_value_2
node3_title cck_field_value_3 (hovering over this field displays whole node)
node4_title cck_field_value_4
node5_title cck_field_value_5
I can get popups to work in a normal node that has an input filter set for the Popup - but not in a table in a view (which as far as I can tell only has an option for an HTML filter).
Is this a feature that is not available, or am I missing something here?
Thanks
Duncan
Comments
Comment #1
Scheepers de Bruin commentedYou can achieve this by using the php of the http://drupal.org/project/views_customfield module, and the following as the php:
Comment #2
Roulion commentedMay i assume this "popup_filter_process_text" function might be used in node template to display fields in pop-up, such as
popup_filter_process_text('[popup php='.return $node->name_of_my_field[0][view].']');Comment #3
Scheepers de Bruin commentedThat is probably not going to work as is. It all depends on what that field contains. If it simply text then:
should do the trick... (Note the surrounding "")
OR
would work for most other content...
Comment #4
Scheepers de Bruin commentedCheck out v3, it now has popping up of node reference fields built in... thanks for the suggestion duncano74
Comment #5
maxxdev commentedCould you elaborate on this? Do I still need Views Custom Field? I noticed that if I use a custom field and markup it has an input filter for 'Popup Filter'. How do insert variables such as [nid]?
Sorry for all the questions, but this module seems very promising I just can't quite figure out how to use it.
Thanks
Comment #6
Scheepers de Bruin commentedNo you don't
Once you've installed the popup module, you should be able to select "Popup node" as the field format under views field configuration, as well as in the display fields section of content types.
Comment #7
pipicom commentedPlease scheepers could you further explain #6???
I cannot find anything new in the views configuration neither at the "display fields section of content types"..
Comment #8
Scheepers de Bruin commentedMake sure you have both the Popup filter AND Popup filter ui modules installed and enabled.
For a view:
1. Make sure the row style is set to fields
2. Add a nodereference field
3. In the field configuration, set the format to one of the popup filter formats
4. If none of the formats fit what you're looking for, you can have a look at /admin/settings/popup-filter/formats/list to define your own
Hope that makes it more clear
Comment #9
Roulion commentedHI
I tried to use both of the tricks in my custom node-type php template but none of them are working. Could you manage to make it works or was it only a supposition that it might work? Tomorrow i'll try to make it work and tell you. If i can't manage it maybe it could be a worthy feature request to have such a function...
FYI, i have a field with matrix-field widget (with multiple rows) and i want to display the result (a table where the number of row depends on a "for i=0; i
Thanks for your help
Comment #10
Scheepers de Bruin commentedEnable the popup filter ui module and both of those tricks will likely not be necessary.
You may go to the cck content type > display fields > field configuration, and set the format to a popup node format. (This is only for node reference fields, so far)
Comment #11
pipicom commentedPerhaps I am trying to do something different, so excuse me if I am at the wrong post..
Can I use "Popup filter" to achieve similar results to the "VIews popup" module (http://drupal.org/project/views_popup) ?
That is, a simple view where some fields appear on page and others on the popup. An example of a Drupal site that does exactly that is http://www.demotix.com/. Go to "LATEST NEWS" and mouse over any picture; a clickable popup appears.
I have followed all instructions on this page without results. I even installed "Node reference views" (http://drupal.org/project/nodereference_views) but this didn't help me either.
Thanks again Scheepers for your support
Comment #12
Scheepers de Bruin commentedNot quite yet - you can at his stage have a node title insted of an image that pops up the rest of the node...
There is a request to be able to use images for the title... I'm still meditating on how exactly that woud work...
Comment #13
Scheepers de Bruin commentedComment #14
minneapolisdan commentedFollowing your example above, I can get the node title to print in my View, with each title showing the full node on HOVER.
<?php print popup_filter_process_text('[popup node='.$data->nid.']'); ?>But I can't figure out how to change it so it shows on CLICK. It's the limits of my PHP, I admit, but can anyone throw me a bone here? I think I just need to work in the parameter, activate=click, in there somewhere, but can't figure out where or how. I assume it's working on Hover because that's the default.
Thanks for any help out there.
Comment #15
Scheepers de Bruin commentedas described on http://drupal.org/project/popup_filter
Comment #16
minneapolisdan commentedThanks for the reply. I'm still not having any success but I'm assuming this works as stated, so it must be something else I have going on. I'll try some other options.
Comment #17
kvyn commentedprint popup_filter_process_text('[popup text='.$data->teaser.' activate=click]');I've tried to implement the above in views on a custom field.
The row style of the view is set to fields
The expected link shows up in the views but doesn't show the popup.
If i plug the following code in as normal content then i get a popup as expected.
[popup text='do rae me' activate=click]
The problem is that the popup filter tag works in conventional nodes and not the view preview mode.
Other factors that could affect this are :
1. Views as being displayed in Quick Tab blocks.
Can anyone help ?
Comment #18
eL commentedI need variables about current field of View in popup. It seems, only way is PHP. But, I am able to display popup link and popup itself only with Markup Custom Field. With PHP Custom Field is it impossible, because popup tag is not recognized. And popup_filter_process_text doesnt work here too. i Mean - is there any way how to use View Field Variables in generated popup?
Comment #19
Scheepers de Bruin commentedYes there is.
Set up a custom filter that first runs a php filter and then a popup filter.
Comment #20
eL commentedscheepers - thanks, you are right!
Comment #21
eL commentedHm, but why this is not working?
How to pass customized output to the text popup, if we could not use print or echo in process_text function?
Comment #22
Scheepers de Bruin commentedis equal to:
print popup_filter_process_text('[popup text=<a href="">link to profile</a>]');which is obviously not a valid popup tag.
In such an instance I would rather do:
Comment #23
Scheepers de Bruin commentedComment #24
eL commentedThanks, but your code doesnt work. 500 internal server error. And I add missing ] to your code.
Edit: It seems, in PHP custom field could not be function declared (?) http://drupal.org/node/902132
Behaviour of Popup Filter is quiet weird, because:
$pop = "<a>test</a>";put to TEXT popup works fine. But$pop = "<a href>test</a>";is not working...It seems, that problem is with white space... (?)
Comment #25
eL commentedYes, problem was white space and quotation, that are needed for strings, this code works:
but only with
<a href>test</a>if quotation or = is added to path, it doesnt work again
So, are we clear?
- we could not use popup TEXT, because it could not handle some HTML tags with some characters like =
- we could not use popup PHP, because it need return from function (why? why is not allowed print $variable?)
-
we could not declare own function with return value, because (probably) Custom Views Field PHP has bug and functions are not allowedComment #26
eL commentedI moved a little bit, but still stuck...
We can not declare function in Views PHP field, but we can declare it in own module and pass variables to that function through arguments.
In module:
In Views PHP:
***doesnt work, why???***
If I replace $pop argument in function with some text directly, it works... but it is not acceptable.
Comment #27
Scheepers de Bruin commentedOk. How about I give you some realish example. In your module:
And in your view:
In your sample code the $pop variable does not share the same context as the evaluated code in the php attribute.
Comment #28
eL commentedThanks,
almost there. But this is quotes and apostrophes HELL :)
Function as is works, but inside popup filter argument doesnt work, if it is more than one word. We probably need some other quotes put somewhere.
Comment #29
RoastBeats commentedI was having a terrible time trying to get the popup working in view with a dynamic argument. I could get it working if I specified the node ID simply by using the popup filter, but as soon as I had to implement the above PHP function to incorporate a variable, I got this error: "Fatal error: Call to undefined function popup_filter_process_text() in..."
I still have no idea why it couldn't find the function, but thanks to http://drupal.org/node/1122452#comment-4344318 I was able to figure out a very hack-ish work-around.
In my Views PHP field I added the following code before running the code provided by scheepers earlier in this thread:
module_load_include('inc', 'popup_filter', 'includes/popup_filter.processing');That called the appropriate function and allowed me to insert dynamic variables to my heart's content. I know it's a bit of a workaround, but thought I would post here in case it helps someone else.
The full code looks like this: