PDA

View Full Version : Load pacific page into an iframe when entering a page?



Collectors-info
07-08-2006, 10:46 AM
Hi, when entering 1 of my pages with a iframe, can I tell the browser to load a pacific page into the iframe of my choice rather than the default one that opens up on the 1st visit. This page with the iframe will have many subjects that will open within the frame via an index on the parant page . What would be nice is for a visitor to click on a link from another page & arrive at the page with the subject already loaded in the frame to save going through the index. IE.
(Link to this main page. But with this article in the iframe) Not the default one.


Hope you can help.


Chris.

Big-D
08-12-2006, 06:19 AM
Chris,

I wanna create exactly the same thing too. But all I get is the usual runaround-&-search for yourself. I ended up making the page with multiple bookmarks. A bit long on the loadup time, but what else can I do? Make the link show in a popup window?

navaldesign
08-12-2006, 06:49 AM
You can't do it directly in BV, at least not in a simple way. You see, this requires passing over variables from one page to the other. The only way you can do this in html is by means of a form, which means that your links from the original page should be practically "Submit" buttons, with value equal to the link to be opened in the iframe. If you do follow this method, then the page with the iframe should have a piece of php code at the very beggining, that would "grab" the value submitted by previous page, and "echo" this value as the initial iframe link. This way the i frame would open directly the page submitted by the submit button. Of course you need to publish the iframe page as php.

Maybe there is some other way using javascript but i don't know it.

navaldesign
08-12-2006, 10:31 AM
To see an example of what you want, please click on:

http://www.navaldesign.info/Tips/variable_iframe_link_startpage.html

Collectors-info
08-12-2006, 11:54 AM
Many, many thanks Navel. This will be put to good use. Once I get my head around it.
There are so many posts on the .NET that says it canít be done. Nice to know they where wrong

Thanks again,

Chris.

Big-D
08-14-2006, 09:29 PM
Nav D, the image on your sample page just below the i-Frame isn't loading properly. Only half of it shows. The bottom half is blank, so I really can't see what you are trying to show.

Collectors-info
08-14-2006, 09:46 PM
Nav D, the image on your sample page just below the i-Frame isn't loading properly. Only half of it shows. The bottom half is blank, so I really can't see what you are trying to show.

It may be your browser, i get this as the last line on that page.

Ok. You are done. Save your page and publish it.

Chris.

Big-D
08-14-2006, 10:54 PM
No, it happens with IE & FireFox. Latest versions. It's the image below the i-Frame just above the "read more" button. The rest of the page loads fine. I'm talking about that image. 1/2 image.

Andy128
08-15-2006, 12:33 AM
Or perhaps you could treat it like that of loading pictures from one I-Frame to another. Remember the tutorial that had one large I-Frame and then a smaller one underneath? When you clicked on a thumbnail in the smaller I-Frame, the larger one would appear in the larger I-Frame.

That might? Just make the Smaller I-Frame with no border /scroll bar and the page with the links the same back-ground color as the main page.

Does that make sense?

Andy

navaldesign
08-15-2006, 06:55 AM
Nav D, the image on your sample page just below the i-Frame isn't loading properly. Only half of it shows. The bottom half is blank, so I really can't see what you are trying to show.

Sorry, the page is loading quite well for me, and seems to be loading ok for others too. Can't suggest anything. and there are four images unser the i frame. Anyway, i can post the instructions here if the problem persists for you.

navaldesign
08-15-2006, 07:03 AM
It may be your browser, i get this as the last line on that page.

Ok. You are done. Save your page and publish it.

Chris.

Chris, that's the first page, Big-D is talking about the second page. However, in the second page there are the instructions on how to build it.

Collectors-info
01-08-2007, 11:11 PM
HELP! Naval can you help please. I thought I got it right but canít get rid of the text link at the top of the target page.
There are 2 links on this page. http://www.collectors-info.com/if2.html but when pressed they work OK, but you can see what happens.

The target page is this one http://www.collectors-info.com/if.php & this loads fine.

Thanks.

navaldesign
01-09-2007, 05:29 AM
Hi Chris

what you see is part of the code used to create the "clocks and *******" button on the first page. Probably you have placed Amazon's code in the page, then when you created the second page, you deleted this code, but not all. Check it, i'm sure there is something in there. If you still can't find it, please email me the .bvp files so i can have a look.

Collectors-info
01-09-2007, 10:33 AM
Hi Naval, SORRY, you have mail. Couldnít find anything on the page. Strange!

navaldesign
01-09-2007, 12:08 PM
Chris, you have mail.

Collectors-info
01-09-2007, 02:01 PM
Many thanks Naval,
Got the 1st one working fine & all links work great. This will look a lot better with links direct to a product.

But on the second one you suggested it loads the page fine, but the iframe loads the home page for the store & not the specific link?
Would it have anything to do with iframe URL being <?php echo $link;?>.
Should it be something like <?php strlen $link;?> (not sure)

Put this in the html box.
<?PHP
@$link = addslashes($_POST[link]);
if(strlen($link) == 0)
{
$link = "http://astore.amazon.co.uk/collectables-21";
}
?>

This in the frame

http://i23.photobucket.com/albums/b387/COLLECTORS-INFO/iframe.jpg
Not sure if there should be a space between the ; ?>

And this in the button.

http://i23.photobucket.com/albums/b387/COLLECTORS-INFO/Button.jpg

Saved this page as .php

Any suggestions as to what might be wrong as this would look a lot neater.



Many Thanks.

navaldesign
01-09-2007, 03:29 PM
Chris, the second solution DOES NOT receive any $_POST variables, and the code should be simply

<?PHP
if (strlen($link) == 0)
{
$link = "http://astore.amazon.co.uk/collectables-21 (http://astore.amazon.co.uk/collectables-21)";
}
?>


Just delete the line @$link = addslashes($_POST[link]);
Your buttons seem ok, your frame is ok, it's the code that is wrong. Since it receives no $link the link results null, so it points the frame to your homepage.

And there is no need to save the page with the buttons as .php, though it should work the same.

Collectors-info
01-09-2007, 05:04 PM
Hi , my apologies the code I posted was from the old page. This is the one in the page which was correct.


<?PHP
if (strlen($link) == 0)
{
$link = "http://astore.amazon.co.uk/collectables-21";
}
?>


But still no joy with the 2 new pages. (still get the home page loading)

New Target page is this http://www.collectors-info.com/ifthree.php which works great

New Linked from this http://www.collectors-info.com/if4.html this one should link to

http://astore.amazon.co.uk/collectables-21/026-3481376-7171665?%5Fencoding=UTF8&node=17

Using this link ifthree.php?link=http://astore.amazon.co.uk/collectables-21/026-3481376-7171665?%5Fencoding=UTF8&node=17

http://i23.photobucket.com/albums/b387/COLLECTORS-INFO/SMASH.gif
Arhhhhh Thats beter! Only Joking.

navaldesign
01-09-2007, 05:18 PM
Chris,

delete the html box. Paste the code in the page html, in the Start of page Tag.
The whole thing depends on the order they have been placed in the page. If you paste the code in the start of page, i think you should have no problem.

Collectors-info
01-10-2007, 11:08 AM
Hi Naval, really appreciate the help, but for some reason I canít get the second one to work, Place it at the start/head/inside, naturally deleting the previous 1st. I even made an iframe & placed it in body. But with no luck.
But for this situation I only need one button for each of the pages so the submit/form button way will be fine.

Once again, thanks for the help.

Chris.

navaldesign
01-11-2007, 08:30 PM
Hi Chris,

the above doesn't work because the & sign breaks the link. However, it can also be done without a form. Have a look at http://www.navaldesign.info/Tips/c-info1.html
If you need instructions, let me know.

Collectors-info
01-11-2007, 09:11 PM
Hi Chris,

the above doesn't work because the & sign breaks the link. However, it can also be done without a form. Have a look at http://www.navaldesign.info/Tips/c-info1.html
If you need instructions, let me know.

Like it! Yes please.

Thanks.

navaldesign
01-11-2007, 09:22 PM
Chris, please send me your email (i have it in my office, but not here)

Collectors-info
01-11-2007, 09:57 PM
Hi, you can reach me on this one.
http://www.collectors-info.com/contact_us.php

Or I have sent my private one to navaldesign.it

navaldesign
01-11-2007, 10:00 PM
Chris, i have already sent you an email with the files attached.

Collectors-info
01-11-2007, 11:20 PM
Hi, I will try this in the morning, but I assume that I extend the php in the page like bellow.

<?PHP
if ($link == 1) {
$link= "http://astore.amazon.co.uk/collectables-21/026-3481376-7171665?%5Fencoding=UTF8&node=42";
}
if ($link == 2) {
$link= 'http://astore.amazon.co.uk/collectables-21/026-3481376-7171665?%5Fencoding=UTF8&node=17';
}
if ($link == 3) {
$link= 'http://astore.amazon.co.uk/collectables-21/203-6656348-4462346?%5Fencoding=UTF8&node=23';
}

if (strlen($link) == 0)
{
$link = "http://astore.amazon.co.uk/collectables-21";
}
?>

And add extra link like this

</DIV>
<DIV style="position:absolute;left:9px;top:163px;width:720px;h eight:39px;z-index:2" align="center">
<BUTTON type="button" onClick="window.location='c-info2.php?link=3'" style="width:720px;height:39px"><P><FONT style="font-size:13px" color="#000000" face="Arial">Double click to edit</FONT></P></BUTTON>
</DIV>

Many Thanks
PS
Might have a little bit of work for you??
Can you make a program or maybe purchase one & pull it apart to make menus like this
http://i23.photobucket.com/albums/b387/COLLECTORS-INFO/ld.jpg
The image above came from this site. http://www.all-linksite.com/
IE: A databas for URL's with maybe 3 style sheets. It would work just like a link directorys menu, but end up at a url of your own choice. Will make up some web pages to explain a little clearer if its the sort of work you might do.

Thanks again.

navaldesign
01-12-2007, 04:37 AM
Hi Chris,

1. Just add in the first page, another button, make it on Click, with the Onclick action set to "Go to the specified URL" and Onclick Value "c-info2.php?link=3"

Then, in the frame page, you add the third "if" statement as you have it above.

2. Yes, it can be done. It requires a Database as you said. It has to be designed in a certain way, in order to be efficient, but i can do it. I don't understand though, what you mean be "but end up at a url of your own choice".

Collectors-info
01-12-2007, 05:56 AM
Hi Naval. Many thanks for the above. You must be on the night shift?
I have looked all over the net & was looking for a better menu system for large menus. This is the closest I have come across.

Front end http://www.gentlesource.com/demos/demo-link-manager/
Back end http://www.gentlesource.com/demos/demo-link-manager-admin/
Home page http://www.gentlesource.com/link-manager/

& this may do the trick. But if the menuís got to large it would be much better to be able to drill down the menu like some of the reciprocal links type software.
The most important part would be to see how many files/url are in each area.
IE:
1st page of menu. Click on website hosts. (Go to new menu)

Websites Hosts (19) Website Engineers (46) Website software (123)

Websites hosts. Click on Unix. (Go to new menu)

Do it your self Hosts (07) Microsoft Hosts (06) Unix (06)

Unix
Click link. Go to url

Link unix host 1?????
Link unix host 2?????
Link unix host 3?????
Link unix host 4?????
Link unix host 5?????
Link unix host 6?????

A small bonus on the software above is that it also tells you how many visits a url has had. This one is only an inexpensive software & wasnít sure if it could be adapted. If you give me a day I will set up a couple of pages on how it would be nice to work.
Oh! The url part was to work the same as this one, direct to a page on my site or any other site. Would be nice to have the facility to tell the link to be _blank _ self _top etcetera, as I am not sure if these menus would have to go in an iframe or could be place on a bv page another way. It would also be nice to link to my own site as _self, but to anther site as _blank.
Right! time for some Zzzzz's the birds have just got out of bed over here.lol

Cheers.