1
BigJim
Can a single iframe display differing website links?
  • 2008/2/15 2:51

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


I want to have a block for one module which displays an iframe of a relevant website.

The difficult part is that it needs to be a different website link for each article of the module.

Right now I have hacked smartsection so that every article (item) has a unique external website link. I would like to change it so that instead of a link the website itself displays within my site.

I've got Myiframe which is great but with my limited php knowledge I can't figure out how to tell the iframe to communicate with my smartsection_items table to find out which link to wrap for each different article.

Can this be done? Any help is really, really appreciated

Thanks

2
BigJim
Re: Can a single iframe display differing website links?
  • 2008/2/21 1:36

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Can anyone help me on this?

Not sure I explained it too well.

Basiclly I need to split the page in to two,top half will have the article, bottom half will display a related (external) website using frames.

I've tried creating a block using myiframe but can't figure how to make it return a differnt website for each article

The website link for each article is already in the database table but how can I code it to have the relevant website displayed for each article?

Thanks a lot!

3
BigJim
Re: Can a single iframe display differing website links?
  • 2008/2/25 9:45

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Try another bump for help, i'm under pressure to get this done so i anyone can offer any help I'll be really appreciative

So take a module like the module repository, when you click on each module you can see the download link, what I need is for each link to display as a frame within the page, rather than taking users to a new, external page.

Using myiframe I can only see how to set up one individal link per block, whereas I need the frame to be a link to whichever link is associated with that page.

PLEASE HELP!!! THANKS

4
Peekay
Re: Can a single iframe display differing website links?
  • 2008/2/25 12:02

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


You can use the 'target' param in a link to target a named iFrame.

There's an example here:

http://www.codeave.com/html/code.asp?u_log=5048

Perhaps you could add the iFrame to a (large) block under the list of links?
A thread is for life. Not just for Christmas.

5
tcnet
Re: Can a single iframe display differing website links?
  • 2008/2/25 12:40

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


If I understand correctly, the external url is already stored in your db, has been assigned to a variable and you can display that variable as a text link on the article's page.

All thats left to do is add an iframe to the smartsection_item.html template to display the external webpage for each article.

templates/smartsection_item.html around line 27
After:
<
div class="itemText">
   <{
$item.maintext}>
div>

Add:
<
iframe SRC='<{$yourvariable}>' scrolling='no' width='100%' height='290' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0'>
iframe>


Don't forget to update the module after editing the template.

6
BigJim
Re: Can a single iframe display differing website links?
  • 2008/2/26 4:12

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Thanks a million peekay and tcnet!!

tcnet - your answer was just what I was looking for but it is not quite working because the external url's stored in the database are returned as weblink text

So the source is like this:

src="http://www.bham.ac.uk">

I know (I think) this is to do with the item handler but can't figure how to change it.

Do you know how?

Thanks again

7
BigJim
Re: Can a single iframe display differing website links?
  • 2008/2/26 8:03

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Got it! Just needed to go to smartsection/class/item.php and delete the mytextsanitizer instruction for the weblink variable.

Brilliant! now it works perferctly both via the item.html template and using myiframe.

Thanks again - I'm so happy!!!!

Login

Who's Online

368 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 368


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits