Using link #id attribute with frames...

User 2078965 Photo


Registered User
7 posts

Hello,
Apologies if this has been posted elsewhere, couldn't locate the info I needed. I'd like to link to specific part of page A from page B on my website. Here's the code I have been using:

<a href="/news/news.html#Reflection" target="_top">

The problem I have is that page A (news) contains 2 frames (menu & news) and this code only returns the 'news' portion, albeit at the correct part of page. Page B has no frames.
Is it possible to link to correct part of the 'news' page and also have the menu there?
Appreciate any help,
Ed.
User 187934 Photo


Senior Advisor
20,271 posts

ER Are you looking for a link to place on the same page as the iframe or on a different page? Do you want to scroll to the location in the iframe or to the location of the iframe on the page?
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,649 posts
Online Now

E R, are you talking about Iframes, or is this a regular frame set?

It would help if you could provide a link to your site.
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 2078965 Photo


Registered User
7 posts

Eric, Inger
Thanks for your responses - my website is http://www.jungturks.com
I'm pretty sure it's a regular frameset I'm using, my html knowledge is very limited (obviously!).

As an example, I want to link from this url http://www.jungturks.com/news/mn1.html to its' corresponding thumbnail at this url http://www.jungturks.com/news (Reflection 1-5). When I use the code I posted above, it fails to return both frames in the frameset (but it does scroll to the correct location).
User 38401 Photo


Senior Advisor
10,951 posts

Hiya ER,

The reason that is is because the frames are actually separate pages for the most part. I would highly suggest you update your site to not be frame based as that really has very little support these days and is very seldomly used anymore. What you're doing for your site is easily done with HTML & CSS or even if you decided to try the Visual Site Designer. At that point you could easily include pages and the entire page or section etc. would be included.

The way you have it setup now you will have to reference any and all parts of the frames themselves to include them into other pages etc. This can be done of course, but it's trickier and it's very very old coding.
User 122279 Photo


Senior Advisor
14,649 posts
Online Now

I had a look at the site, and it is a frameset all right. As JoAnn is saying, such frames are kind of 'out', as there are much better ways to create websites now.

If you start over, you would also get rid of some very serious errors in the coding, such as the missing doctype declatation and character set declaration. The latter would help getting the unwanted question marks in the text disappear, among other things.

Both VSD and the HTML Editor, both from Coffeecup, produce correct, valid code. If you are a 'drag-and-dropper', you could go for VSD, but if you are familiar with coding in html and css, the HTML Editor would be the tool for you. Since you are allowed to test both progs some weeks before you make up your mind, I'd download and test run both.
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 2078965 Photo


Registered User
7 posts

Thanks for the advice Jo Ann and Inger - the site is due an overhaul so i'll certainly check out that software, very happy with CoffeeCup Direct FTP.
In the meantime, is there some code I could use as a workaround for the issue? Again, any help is greatly appreciated!
User 122279 Photo


Senior Advisor
14,649 posts
Online Now

For the frameset page, you could start your page like this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>JUNG TURKS</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

After that you go on with the other meta tags.

This is the page top for the menu and news pages:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />


Also notice that you have the link to the style sheet twice in all three files. Once is enough ;)

In order to get rid of the question marks, you have to correct the text first, and then it should display correctly.
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 2078965 Photo


Registered User
7 posts

Thanks very much for that Inger - please excuse my ignorance of html, but does your code address the link issue as well as correcting the doctype & character set declaration errors?
User 122279 Photo


Senior Advisor
14,649 posts
Online Now

No, this was only the doctype and character set. I'm still not quite sure what you you want to link to from where.
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.