iFrame style HTML link

User 371048 Photo


Registered User
59 posts

I'm unsure how to utilize an iFrame in a link on a website so the frame of the site remains on screen along with the portion of an eStore that is online...

The site is here: http://www.somaluxury.net/dev4/index.htm
Loading the Shopping Cart works fine if you choose the GO SHOPPING link on top ... it basically loads the store in an iFrame with:
<iframe src="http://www.somaluxury.net/dev4/store/index.php" scrolling="no" frameborder="0" width="100%" height="100%">

However, if I wish to load just a specific item from within the Shopping Cart via a link on this page, e.g. BATH BOMBS from the left hand inset, I'm unsure how to bring up that portion of the shopping cart.
Currently, I am doing an <a href="...."> </a>. Is there a way, instead, to load just the specific portion of the page I am trying to get to via an iFrame or something similar? (The page I would like this example to bring up is the same as if you click on the GO SHOPPING link in the top menu bar and then the LUXURY BATH BOMBS product on the right hand side.)

Thanks you.


-- me



User 2073552 Photo


Registered User
1,625 posts

<iframe width="100%" scrolling="no" height="100%" frameborder="0" src="http://www.somaluxury.net/dev4/store/viewitem.php?productid=36">
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 371048 Photo


Registered User
59 posts

SirAGE wrote:
<iframe width="100%" scrolling="no" height="100%" frameborder="0" src="http://www.somaluxury.net/dev4/store/viewitem.php?productid=36">


That will load the page I want, but how to I make that a link? e.g.
<a href=" [the iframe link above] "> Bath Bombs </a>

I'm unsure how to load the complete page with the iframe in a link.
When you go to the website ( http://www.somaluxury.net/dev4 ) and click on GO SHOPPING along the top menu, and then the right side item, BATH BOMBS, that is the exact page that I want to load when you just click on "BATH BOMBS" from the main page in that left side inset.
-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

I'm thinking your actually needing some JS.:)
http://progrower.coffeecup.com/iframeswitch.html
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:
I'm thinking your actually needing some JS.:)
http://progrower.coffeecup.com/iframeswitch.html


OK ... I can see partially where this can help but would require a complete redesign/change to the main site page I think. Alternatively, if a person could carry forth a variable somehow within the link from the main page ...

e.g. <a href="somaluxury.net/dev4/store.htm?product=63> Bath Bombs </a>

The page store.htm already loads the iframe of the entire shopping cart, so if there was a way to make this work so when a user clicks BATH BOMBS, the store.htm page loads and chooses the proper variable, in this case 63, to display the appropriate iframe instead of the entire shopping cart as it does now? Does this make sense and, if so, is there a way to make that work without a complete redesign?

-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

I'm lost on what your looking for on the original question. Are you trying to link to an iframe or have a link that's on a page being loaded in an Iframe load a specific way?
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:
I'm lost on what your looking for on the original question. Are you trying to link to an iframe or have a link that's on a page being loaded in an Iframe load a specific way?


Sorry ... hard to explain.

If a user clicks on BATH BOMBS on the main page, it should take them to a page inside the shopping cart with just the BATH BOMBS item on the screen, as if one drilled-down to that item from within the cart. I can see where your suggestion of using java script per your example page would work but I think that would require me to redo the index.htm page if I am interpreting correctly.

Currently I load the entire shopping cart via an iframe as I want to keep the header and footer of the site there at all times and CC Shopping Cart does not allow me that option. But to load just one section of that shopping cart, one item or one item group, via a single click from the main page is what I'm unsure how to accomplish.



-- me



User 187934 Photo


Senior Advisor
20,266 posts
Online Now

I think my suggestion is the way to go. Just replace the src's with the proper link to your shop content.
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

jayjay wrote:

Sorry ... hard to explain.

If a user clicks on BATH BOMBS on the main page, it should take them to a page inside the shopping cart with just the BATH BOMBS item on the screen...

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.
A more elegant way would perhaps be using php and mysql and store the items in a data base, and then call the ones that are needed.

I'm not so well versed in php that I could write that script for you (I would be able to create the database, though), but there are others with more knowledge around.

If you go for the easy solution, making a page for each item group, I would not set the iframe width to 100% if I were you. Make it 620px wide and put it into your textbox class. That leaves room for the small menu on the left to be visible.

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! :)
Ha en riktig god dag!
Inger, Norway

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


User 371048 Photo


Registered User
59 posts

Eric Rohloff (Rolly) wrote:
I think my suggestion is the way to go. Just replace the src's with the proper link to your shop content.


I may be missing something, but I don't believe I can replace a link on my main page with your suggestion so an existing link pulls up and displays the appropriate portion of the shopping cart. As the main page is setup, the inset has this code:

<div id="products_bath_inset" class="text6">
<a href="http://www.somaluxury.net/dev4/store/viewcategory.php?groupid=8">Luxury Bath Salts</a><br>
<a href="http://www.somaluxury.net/dev4/store/viewitem.php?productid=48">Bubble Bath</a><br>
<a href="http://www.somaluxury.net/dev4/store/viewitem.php?productid=36">Bath Bombs</a><br>
</div> <!-- end product_1_bath_inset-->

The 3rd link down is the item ... so, you're suggesting I change this to:

<a target="iframeswitch" href="bathbomb.html">Bath Bombs</a>

and then create a new page named bathbomb.html

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

to place the above code in? If that is the case, with each change we make to the 1st page for specials, we'd have to create a page like this?

Would that carry over and work with the CC Shopping Cart so people could place an item in their cart, move around the site, and still retain what is in their cart for checkout?
-- me




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.