iFrame style HTML link - Post ID 199442

User 371048 Photo


Registered User
59 posts

Inger wrote:

Have you got such a page, with only the bath bombs? An easy way of showing specific items in an iframe would be to create a page with ONLY those items. ...


Not sure if this matters, but I am using CC Shopping Cart Creator Pro... a page with only the specific category or product that is on special or featured would require a change to the shopping cart each time, correct?

Inger wrote:

Come to think about it, there is also another way. You can use and anchor to a specific position on the shopping page. If you don't know how to do this, then holler! :)


I'd be interested in seeing an example of an anchor to see if that would work, Inger.

Thank you.
-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Isn't this what your trying to accomplish?
http://progrower.coffeecup.com/iframeshopswitch.html
Then use this code if you only want to show a particular area loaded.
Eric Rohloff (Rolly) wrote:
It sounds like your trying to do what I did on a page. This code will position the iframe over the area in the embedded page where you need it. Just tweak the numbers until it shows what you need.:)
CSS

<style type="text/css">
<!--
#main{
width:725px;
height:455px;
border:1px solid #000;
overflow:hidden;
margin:auto;
}
#main iframe {
width:950px;
height:1300px;
margin-left:-218px;
margin-top:-525px;
border:0 solid;
}
-->
</style>


HTML
<div id="main">
<iframe name="iframeswitch" src="http://progrower.coffeecup.com/shop/viewitem.php?productid=45" width="950" height="1300" scrolling="no" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
</div>

I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 371048 Photo


Registered User
59 posts

Eric Rohloff (Rolly) wrote:
Isn't this what your trying to accomplish?
http://progrower.coffeecup.com/iframeshopswitch.html


I don't think it's the same ... I'm trying to bring up just a portion of the complete shopping cart ... one item that will allow the user to choose the style/color of that item and order it. I can see where the javascript would allow the link to load an image, but will it load an iframe inside of a second html page?

I may be overanalyzing this as I tend to do, but since my shopping cart is at /store.htm wouldn't I need to create another page for BathBombs, for example?

OR, would I just alter my store.htm page and I could then direct any link on the main page to open a specific product or group within the store in an iframe?

SO ... I have 3 links on the main page.

Link 1 opens the entire store in an iframe (which I do now)
Link 2 opens just product 1 from the store in an iframe
Link 3 opens just product 2 from the store in an iframe
(and this is the part I am struggling with to understand ... link 2 and 3 would have to be similar to the store.htm page with just a different portion of data within the iframe).

Because I want the link on the main page, in order to use this Javascript, I would have to have the main page also be switched in and out via Java would I not? Else, the code:

<iframe name="iframeswitch" src="pagea.html" width="300" height="200" scrolling="no" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>

would have to be on the store.htm page, which I would need to get to before I did the link (I think?)
-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

The CSS I posted will bring up just a potion of an iframe. Give it a try.
You could then once again use some awesome js to switch the style sheet for each iframe.:cool:
http://javascript.about.com/library/blswitch.htm
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 371048 Photo


Registered User
59 posts

Eric Rohloff (Rolly) wrote:
The CSS I posted will bring up just a potion of an iframe. Give it a try.
You could then once again use some awesome js to switch the style sheet for each iframe.:cool:
http://javascript.about.com/library/blswitch.htm


I'm sorry ... not sure why I am stumbling so bad with this one and I very much appreciate all the assistance.

I made another page, /store2.htm that shows the page I am trying to get to from a link on the main page (Bath Bombs). For some reason I cannot grasp using 1 file ( store.htm ) to show different items from within the store depending upon what is clicked from the main page.

I will continue to play around from this see if it finally sinks in.

-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Do one thing at a time. Set up each iframe to capture the area of each page wanted with the css for each. Now tackle the js to switch out the css for each iframe. If I get a little time I'll monkey around with it but I know the iframe loading a portion of a page works because I'm already using it.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,621 posts
Online Now

I guess Eric's solution is the best when you think of adding more items by and by. Since I don't use the CC Shopping cart, (and I didn't know you were using it until now) I'm not sure how the items are stored, but probably not in a database, although I thought I saw a php file extension before you made the 'store2.htm etc.

Having checked the markup of the store page, I don't think that the anchor solution would be the way to go, unless you replicate the store page in simple html/css with links to the 'real' page and put it 'in front of' the original store page. More work, especially if there are lots of updates.

Anyway, on the page with the items you have to add something like this to each item:

<a name="bathbomb">


The iframe would then look like this:

<iframe width="100%" scrolling="no" height="100%" frameborder="0" src="http://www.somaluxury.net/dev4/store/extrapage.htm#bathbomb"></iframe>


The 'extrapage.htm' is the one I said you'd have to create. The dimensions of the iframe may of course be edited to fit. But it's a lot of work, and the solution you have used so far seems to work, or you'll be able to utilize Eric's jave script solution.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.