1

I am developing a small web application in CakePHP which allows user to create contents using tools I provide. Once user is done creating the contents, I want to give an option to embed that in her own website.

There are 2 ways I can think of right now to do this

  1. Using iFrame embed code
  2. Giving unique link to that content

Are there any better ways to generat an embed code?

Later on I would also like user to give style (css etc) to the contents she has created.

abhi
  • 97

1 Answers1

2

You can use Javascript. The script tag can point to a piece of JS on your server the JS would insert a div (or iframe or whatever you want) into the users html document.

The JS script can also be dynamically generated (by PHP, Python, Ruby, etc.) which is how the JS would insert the correct content.

so for example:

<script type='text/javascript' src='http://yoursite.com/content_embed.js?content_id=1234'></script>