Forum
Embedding Twitter into a Blog Post
Hello,
I'm trying to embed a tweet into a blog post i was writing (example of how i am trying to do this here: https://dev.twitter.com/web/embedded-tweets) but when i add the necessary jquery and paste the code in it doesn't render as it should. Any idea why this isn't working? I thought it was because my version of perch was too old but it's still not working.
You would need to give us more information if you would like help.
What code are you pasting in, and to where?
Also we need your template and Diagnostics Report (as requested when you created the thread).
Hello,
Sorry for the delay, i didn't have email notificatiosn turned on. This is a copy of the code:
Embed code from Twitter:
I am pasting this into my blog post textarea through the blogging app.
Diagnostic Report:
and would you like the code in my template or the name of it? Sorry, i'm a bit unsure of what you're asking me for.
The code of the template you are using and an explanation of what is happening when you paste this in.
Hello Rachel,
Here's my template code from post.html:
when i paste the code in it renders as a blockquote but doesn't pull in the rest of the tweet for example, the image, the tweet text, twitter's styles etc.
You're using Textile formatting on the post field, so you'll not be able to paste HTML in directly. It will get encoded.
Oh, is that still the case if I paste it into the Source Code area provided?
If you want to post in HTML you need to set html to be true on your field.
Ah, a frequent problem I've had with adding "html=true" is that i'd like to be able to add spaces between lines in my blog post via the editor and when i add the above it doesn't work. Is there some sort of perfect template line that will enable me to have things like the Twitter plugins to work but to be able to add spaces between my copy as and when?
Would the below be correct?
By spaces, do you mean empty paragraphs? Or something else? What HTML are you trying to produce?
Yes, sorry empty spaces; the equivalent of a html <br> tag.
I think something like CKEditor might let you do that.
Ahhh, brilliant - thank you very much. So if i,
I should be able to successfully embed tweets into my blog posts?
You can't use Textile with CKEditor - remove the
textile="true"
attribute and usehtml="true"
instead.Ahh, thank you very much, i'll try this and see how i get on. In the meantime I'll mark this as a solution.