Jump to:
| Project: | Flash Node |
| Version: | 6.x-3.1 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I need to dynamically pass flashvars to my swf file, so I need to use PHP in the flashvars field.
However, I cannot for the life of me figure out how to set the input format for the flashvars field (using flashnode module) to accept PHP code. I've followed the instructions to go to Site Configuration > Input Formats and PHP is enabled and my user role has permission to use it. But then when I enter PHP code, it doesn't treat it as such.
I've noticed on many other fields within other content types the "Input Format" section immediately beneath a text field, and these have PHP as an option. Should I be seeing this beneath the flashvars field? Is that where I define the Input Format for that field? And if so, any ideas why I wouldn't be seeing that option and how I could make it visible? For fields in other content types, I know I'm able to select the "Filtered Text" option by going to Edit Content Type -> (Select Content Type) -> Manage Fields -> Configure for the specific field. However, when I open the Flash Content Type, I don't have the option to configure any of the default fields, including flashvars.
Any ideas would be GREATLY appreciated!
Comments
#1
It's a while since I did this as I've not spent much time on flash node, but...
You need to enable the PHP input filter, then on the content you are creating set its input format to PHP. The input format is applied to the whole node - you don't get a separate or special option for the flashvars field.
Now you just write your PHP code in the flashvars field.
But remember you now have PHP running on the whole node, so you should limit who you grant this capability to.
See this page which gives two example of combining PHP in the flashvars field to pass a variable to the flash content. One sends a simple string, the other queries the underlying database to build a dynamic flashvars string (that takes me back - that was on my personal website when I had the time to keep it updated!)