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 commentedSubscribing, very much interested! greetings, Martijn
Comment #2
Anonymous (not verified) 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 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 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 commentedCan someone help please?
Comment #8
vgulla commentedCan someone help please?
Comment #9
vgulla commentedbumping it to get some help
Comment #10
hdornier commentedsubscribe
Comment #11
vgulla commentedplease help
Comment #12
vgulla commentedCan someone help please?
Comment #13
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 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 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 commentedI just discovered the Views Send module, which is very much appropriate to send content dynamically computed for the recipient user...
Comment #17
igor mashevskyi commentedD6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.
Everyone can apply the patch above (not tested by the maintainers, tested by the community) to their D6 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!