How to position an iframe in the middle of a page using content type display templates?

Options

I want to insert iframe (300px x 260px) that will pull in ads from an ad server and have them display within the body area of several content type display templates. I want the iframe to be positioned in the middle of the page (say after the first two paragraphs of text) and have the text wrap around the iframe. Ideally i want to add this to the display templates so that it will appear in prexisting pages (without having to manually insert it into each page) and not have to burden content loaders who have varying html skill levels. While its simple to have the iframe appear at the top or bottom of a content page, the trick here is getting the iframe to float in the middle of a page and have the text wrap around. Any suggestions?

Tagged:

Comments

  • The only way I can think of to do this would be to use ((Unobtrusive) Javascript) to create a new DOM element after the n-th P tag in the body and populate the new node with the IFRAME needed to get the ad to render.

    Does that make sense?

Categories