Need to insert an iframe into page content

e107 CMS » Forums » e107 Code » Plugin / Code Developer Discussion << Previous thread | Next thread >>
MrMike
May 06 2012, 10:37PM
Registered Member #145064
Joined: Feb 28 2012, 11:45AM
Posts: 21
Hi, I've recently started converting one of my sites to e107 and I need to be able to insert some content (a small iframe) into the pages dynamically.

More specifically, I need to insert the iframe some number of words within content, say 50 words in or so. I can do the php necessary to find the right spot within the content and splice the iframe in, but I'm new to e107 and don't know how or where to access the variable that contains the page's text content.

Most of my pages are custom pages created with the Content Manager plugin or the FAQ plugin (I don't/won't have any News pages).

Obviously somewhere a mysql query is made to retrieve the actual page text(as opposed to the header, footer, or menu items), and this is what I'm looking for.

So, where can I intercept the actual page content (the text, basically)...in other words, what file or what variable would I look at to access this?
[ Edited May 06 2012, 10:38PM ]
Go to top
inebriated
May 07 2012, 04:13AM
  • e107 Support Team
  • e107 Documentation Team
Registered Member #33479
Joined: Jan 15 2007, 07:52PM
Location: East London, UK
Posts: 713
/your_theme/theme.php

This file defines all your layout and where items are shown on the page.

You should insert your iframe in there, or better still make a shortcode and then call the shortcode within the theme.php.

Basic HTML / PHP knowledge would be benificial...
Go to top
Website
MrMike
May 07 2012, 05:42AM
Registered Member #145064
Joined: Feb 28 2012, 11:45AM
Posts: 21
PHPnoobie wrote ...
You should insert your iframe in there, or better still make a shortcode and then call the shortcode within the theme.php.

That's just it- I can insert the frame there, but only in a static position before or after the page content. I can't add it (for example) 50 or 100 words into the text of the article or page content. And that's what I need to do.

I need to access the variable that holds the page content so I can count in X number of words and insert it there, not just at the beginning or end of the content. Where would I find that?


PHPnoobie wrote ...
Basic HTML / PHP knowledge would be benificial...

I'm pretty well versed in HTMP, PHP, Javascript, mySQL, etc. I have some small apps and utilities that I intend (hope) to turn into plugins for e107 once I get a bit more experience with it.
[ Edited May 07 2012, 05:42AM ]
Go to top
inebriated
May 07 2012, 03:43PM
  • e107 Support Team
  • e107 Documentation Team
Registered Member #33479
Joined: Jan 15 2007, 07:52PM
Location: East London, UK
Posts: 713
Ah my mistake, I skimmed over your thread and didnt read it in detail.

What you are asking for is out of my depth im afraid, hopefully someone else can help you out..

That said you say that your using Content Manager and FAQ for your pages, then the files you require to edit are in those respective plugins.
Go to top
Website
MrMike
May 07 2012, 08:40PM
Registered Member #145064
Joined: Feb 28 2012, 11:45AM
Posts: 21
PHPnoobie wrote ...
That said you say that your using Content Manager and FAQ for your pages, then the files you require to edit are in those respective plugins.

Can anyone here give me a line on which file(s) are likely to contain what I need?

EDIT: Actually, it looks like there are a couple of places to do what I want, but the $CONTENT_CONTENT_TABLE_TEXT (in content.php) var is a good place to start. The content_content_template.php in the /plugins/content/templates/default directory may also be a practical place to insert an iframe on the fly.
[ Edited May 07 2012, 10:13PM ]
Go to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System