Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to make my arguments within my view tag dynamic?
If so, what would I use? Rep Tags, PHP, tokens, something else?
An example...
Here's my tag: [view:historical_sites_by_person=block=John Adams]
Lets say I were to place this tag in a block that displayed on both on John Adams' page and Thomas Jefferson's page. I'd like to dynamically add the name of the historical person in the argument field so that I don't have to have dozens of blocks, but only one.
Let me know if this isn't clear.
And thank you.
-JV
Comments
Comment #1
Summit CreditAttribution: Summit commentedSubscribing, very much interested! greetings, Martijn
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedNot sure if this will help give ideas
http://drupal.org/node/337727
I have a node which I insert a view which has an argument (Happens to be a name), I wanted the header of the view to have a standard text but insert the argument (name)
Comment #3
mlsamuelson CreditAttribution: mlsamuelson commentedYou can use PHP, if you enable the insert view filter for the PHP input format.
Following is an example:
Comment #4
PasqualleComment #5
vgulla CreditAttribution: vgulla commentedHi
I hope this thread is still monitored. I am trying to using insert view with views send and want to pass a token as argument like this. This is not working and giving me an error.
Please let me know what I am doing wrong.
[view:mystatus==[views-send-uid]]
mystatus is my view and [views-send-uid] is the token with user's userid
Comment #6
Pasqualleprobably the insert_view filter is evaluated first, in which case the [views-send-uid] does not mean anything for the filter..
Comment #7
vgulla CreditAttribution: vgulla commentedCan someone help please?
Comment #8
vgulla CreditAttribution: vgulla commentedCan someone help please?
Comment #9
vgulla CreditAttribution: vgulla commentedbumping it to get some help
Comment #10
hdornier CreditAttribution: hdornier commentedsubscribe
Comment #11
vgulla CreditAttribution: vgulla commentedplease help
Comment #12
vgulla CreditAttribution: vgulla commentedCan someone help please?
Comment #13
Alan D. CreditAttribution: Alan D. commented@vgulla - did you understand the response from Pasqualle? This means that you need to configure your input filter to ensure that the token filter is run before the insert view filter replacement.
Comment #14
rosso69 CreditAttribution: rosso69 commentedI installed the token_filter module.
Changed the filter processing order. Still it doesn't handle the tokens well.
Creating a node with a token
[view:news=block=[simplenews-subscriber:mail]] shows only an ].
When i replace [simplenews-subscriber:mail] with a xxx@example.org the node shows the view.
Is it possible the ]] is a preg_match problem?
Or do i need to find another solution?
Comment #15
pverrier CreditAttribution: pverrier commentedI'm using Drupal 7 and have the same need: I wish to insert in a (simplenews) newsletter the list of (conference) registrations the recipient has done.
I also tried to use a token in a token, [view:my_vue=my_display=[simplenews-subscriber:user:uid]], and I confirm it doesn't work!
First of all, nested tokens seem, for now, not supported. See issue #2076821 'Please allow for nested tokens'.
Secondly, (@rosso69) if your need is to insert a view in a simplenews newsletter, using Insert View will be no help because input filters are processed before the simplenews tokens are replaced; the only way I found was to create custom tokens; see my solution on issue #1835896 of Simplenews .
Comment #16
pverrier CreditAttribution: pverrier commentedI just discovered the Views Send module, which is very much appropriate to send content dynamically computed for the recipient user...