By Bright Web Design on
Hi Friends,
I would like to know how to add embedded flash code in Drupal7 as a CCK field or at least in body field.
I have tried different things but it seems Drupal filter out the embedded code, hence I can't make it work.
Can any one tell me a tip or some idea to make this work.
This is the sample code I want to put in Drupal7.
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='100' height='130' id='mid' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab'><PARAM NAME='FlashVars' VALUE='id=myid&color=gray&label=myid!&isMaxi=true&description=Quirky arcade-style game&icon=http://mysite.s3.amazonaws.com/myapp/update/icons/icon_myappname.png'/><param name='movie' value='http://mysite.s3.amazonaws.com/myapp/badgebadges/badges100x130_icon.swf' /><param name='quality' value='high' /><param name='wmode' value='transparent'/><embed src='http://mysite.s3.amazonaws.com/myapp/badgebadges/badges100x130_icon.swf' width='100' height='130' FlashVars='id=myid&color=gray&label=myappname!&isMaxi=true&description=Quirky arcade-style game&icon=http://mysite.s3.amazonaws.com/myap/update/icons/icon_myappname.png' quality='high' wmode='transparent' NAME='flaMovie1' ALIGN TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></embed></object>
Thanks in advance.
Comments
It would seem you are looking
It would seem you are looking for SWFtools but it has no D7 release (the only D7 modules I can find are specific to a particular use case).
Have you tried using an input Filter of PHP code or I tend to make an input filter for cases like this that has no filters enabled.
I tried creating my own filter format
Thank you nevets to help me.
I tried creating my own filter format, but no luck.
I tried even the php input format but Drupal7 still filter out the code.
Any other idea or suggestions please....
Thanks in advance.
I took what you posted and
I took what you posted and placed in a node (no filtering) and it shows up in the source but nothing is actually displayed.
So I placed in a straight html file and still does not display so I suspect something is wrong/missing from what you posted.
well i have changed the actual url
well I have changed the actual url and other download url, due to privacy.
If you want I can send by email, the real code.
Thanks for your help.
Not really needed, I set up a
Not really needed, I set up a text format called "As Is" with no filters.
Created a basic page, pasted the code in the body, set the text format to "As Is".
After saving the node, I viewed the source for the html and see the object tag. If the code you are pasting workings in a straight html file it should work with this approach.
The way you said didn't work
The way you said, by creating a new filter format by adding the
<embed> <script>etc. didn't work.I think there is something more to show the embed flash buttons in Drupal7.
Thank you so much for all the helps so far.
Use custom node template
I ever face this same issue, to solve this:
1. I just create a CCK file-field and add swf as allowed extension
2. Input Format = Full HTML
2. Create a node-yourccktype.tpl.php
3. Detect if extension is swf, if yes then: add flash code
<embed>.... </embed>(as you shown in for first post). If image just use
<img ... />Above for D6 but I believe applicable for D7.