How to embed an HTML code in composer ?
-
@meetdilip said:
I get affiliate banners as HTML/ iframe which I would like to embed in the post itself. Is it possible to do so ? If yes, please guide .
Embedding iframes into a post isn't possible with the composer, it would be a massive security issue. Can you paste an example of an iframe, I may be able to make a plugin that does it. But it depends on the affiliate banner and the URLs used etc.
-
@meetdilip Is that the only iFrame you wish to post? Or is their an iframe for individual items?
I could do something like
fkid=141229141866629212
to get the iFrame to display, assuming the ID is the only thing that changes. However do note that any user could do this to get their affiliate code in. Although I could possibly look into making sure it's admin only. -
This is from my affiliate account. I will post a few more samples for you evaluation. I guess it changes with every deal. It will be nice to allow only admin to add the code.
Horizonal bar :
<iframe src='http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141141282406034773' frameborder=0 height=90 width=728></iframe>
<iframe src='http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141229213124264046' frameborder=0 height=90 width=728></iframe>
Skyscraper :
<iframe src='http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141229221834379337' frameborder=0 height=600 width=160></iframe>
-
Haha looks like somebody is getting some upvotes on his entries from @meetdilip
-
Right, so I can't actually test this, as it appears that the iFrames only appear if you're on the allowed list of affiliate users, so I'm only getting a white box.
You can test it by going to your node_modules folder and typing
git clone https://github.com/a5mith/nodebb-plugin-flipkart-iframe.git
Activate it in your ACP, then restart your forum.
Then go to a topic and paste in the affiliate src link. (This bit:
http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141229213124264046
)Let me know if it displays. It should work, the code is valid, the iFrame just doesn't display for me.
-
@a_5mith said:
@meetdilip said:
Where is the option in ACP to activate ? I just used the first command.
If you're on the new style Admin panel, it's under Extend > Plugins.
There is only @Schamper 's Flipkart Affiliate plugin there. I tried CTRL + F and used keywords iframe and flipkart. No luck.
-
@meetdilip said:
@a_5mith said:
Something wrong
http://techiewiz.in/topic/70/lg-l-bello-android-smart-phone-price-in-india-rs-18-500/2
Your sites offline.
-
@a_5mith I'd propose
/<a href="(?:https?:\/\/)?(?:www\.)flipkart\.com\/affiliate\/displayWidget\?(?:[^"]*&)?affrid=([\w\-_]+).+<\/a>/ig