logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-12-2013, 03:37 PM   #1
PtcThatPays
 
Join Date: Dec 2013
Location: Denmark
Posts: 18
Default Should i use Div, Iframe or PHP for links and subpages..?

Hi im new at this forum and found you after some days on google.

I am trying to teach myself Html-Html5-CSS and CSS3 and so far so good but i have a problem i cant find the solution for anywhere.

I am working on my first site ever from scratch and im actually pretty happy about the result so far but i have a huge problem with my links. I cant get them to open where i want to.

First i tryed to open them inside a Div but i have read that that cant be possible apparently so now im trying in an Iframe but thats also not working for me.

I think the problem might be naming the Iframe but i dont know where to name it..? I have read it should be put between the <body></body> tags but i cant get it to work.

Do it have to be in a specific order maybe compaired to my other Divs..?

And is this the correct way to go at all..? Have read alot about Iframes but for some reason most of it was back from 2008 so im thinking there might be another way to do it today.

Instead of posting alot of Html and code here i hoping that someone maybe will take the time to take a closer look at my sourcecode on the site.

The site is live here: http://ptcthatpays.com/

Right now i have 2 tests in a box im trying to open in the Iframe but the plan is to open everything there. Every links and subpages like ptcthatpays.com/thesites.htlml and so on ( not a real subpage just an example for now )

Thanks in advance.
PtcThatPays is offline   Reply With Quote
Old 12-12-2013, 04:38 PM   #2
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Using iFrames the way you want to use it is considered bad practice, because:
  1. it's bad for SEO (you will have the same URL for all the pages)
  2. it's difficult to crawl for SE bots.
  3. if they can crawl then your page is only the iframe content that's indexed in the SERP's. People will come to that page and see only the iframe content, thus no naviagation and sidebars... that's on index.html.
  4. Iframe content can't be bookmarked... same URL problem too
  5. can't use browser back button to navigate back to previous iframe content... same URL problem too here
.
So better to avoid the for this.

For what you want, you need to develop your website with AJAX technology... or if you really want to be modern and hip, with the HTML5 history API (and with AJAX as fallback solution for older browsers)... BUT.... you need to have quite some experience with creating websites in order to work with these things. Better to start with learning HTML & CSS before you dive into this:
AJAX plugin: http://benalman.com/code/projects/jq...ragment-basic/

HTML5 History: http://blog.teamtreehouse.com/gettin...he-history-api






...
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 12-12-2013, 05:41 PM   #3
PtcThatPays
 
Join Date: Dec 2013
Location: Denmark
Posts: 18
Default

Thanks for the reply but ouch.. Have no idea what AJAX is at all besides a detergent to clean stuff here where i live.

And i did read a bit about SEO´s also but was hoping it was old news maybe so it didnt ment as much still.

I dont need to be super modern and hip really i just want the site to work but of cause i want it to be readable for SEO´s.

Issent there something about PHP i can use or am i completely off there..? And if there is which would be the easiest to learn really..?

I have seen PHP before but never AJAX. Dont have a single clue what it is.. But then again it might turn out to be somewhat easy to learn comparing to PHP maybe.

Will take a look at both your links but what would you say is the easiest to learn perhaps..? Im 38 and to be honest stuff dont stick as well as it did when i was younger.

Edit:

Forgot to mention that i will need a contack form at some point and thats why i keep mentioning the PHP part as it is needed for that i know.
PtcThatPays is offline   Reply With Quote
Old 12-12-2013, 06:54 PM   #4
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

No, the SEO thing still stands, because iframes are not meant to create a website framework with it. They're meant to load external website content into your page.

What's the easiest to learn? This totally depends on you. What's easy for me doesn't have to be easy for you. Both technologies are based on javascript and there are tons of tutorials online to learn from.

You can also load snippets of content with PHP in a div, but this still requires a full page reload while this is with AJAX and the HTML5 history API not the case.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 12-12-2013, 08:21 PM   #5
PtcThatPays
 
Join Date: Dec 2013
Location: Denmark
Posts: 18
Default

But issent a subpage exatly just that.. An external webpage..? But never mind as if SEO cant read them.

Guess i just have to learn more then planned.. And ohh have i been planning.. Been drawing the site and planning it for 2 years now and have been learning HTML-HTML-CSS-CSS3 on my own the past 6 months or so.. Was hoping that was enough really.

And im sorry but im a bit confused about this part you wrote "You can also load snippets of content with PHP in a div, but this still requires a full page reload while this is with AJAX and the HTML5 history API not the case. "

I cant figure out which one that requeres a full pageload.

And again i have to mention the PHP.. Can the contactpage/form be made with AJAX/ jQuery also..? Otherwise i dont really have a choise but to do it in PHP do i as i will be needing the contackform. Or can the 2 be combined maybe like you can with HTML and PHP but not the other way around if i undestand it correct.

And how about scrolling..? I have alot on my mind and the space i have now is not enough so with an Iframe i would have used vertical scrool. Thats still possible right with other option..?

Last edited by PtcThatPays; 12-12-2013 at 08:25 PM..
PtcThatPays is offline   Reply With Quote
Old 12-13-2013, 12:28 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,216
Default

mail handling can be done with a mail handling script but does not need to have the whole site using the php extension. you just need to make the action of the mail form point to the mail handling page
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 12-13-2013, 08:06 AM   #7
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by PtcThatPays View Post
But issent a subpage exatly just that.. An external webpage..? But never mind as if SEO cant read them.
No with external website content O meant content that comes from another domain. On another server.

Quote:
Originally Posted by PtcThatPays View Post
And im sorry but im a bit confused about this part you wrote "You can also load snippets of content with PHP in a div, but this still requires a full page reload while this is with AJAX and the HTML5 history API not the case."

I cant figure out which one that requeres a full pageload.
Not sure what you're saying, but with AJAX or History API you can change the content of a div or whatever the element is, without to load the whole page again.

Quote:
Originally Posted by PtcThatPays View Post
And again i have to mention the PHP.. Can the contactpage/form be made with AJAX/ jQuery also..? Otherwise i dont really have a choise but to do it in PHP do i as i will be needing the contackform. Or can the 2 be combined maybe like you can with HTML and PHP but not the other way around if i undestand it correct.
Like edbr said you will need PHP to sent the form data either to a database or an email address, but you can (if you want or need to) use jQuery or AJAX to sent the data also without a full page reload.

Quote:
Originally Posted by PtcThatPays View Post
And how about scrolling..? I have alot on my mind and the space i have now is not enough so with an Iframe i would have used vertical scrool. Thats still possible right with other option..?
That's indeed possible, but then you will have two scrollbars... there's one on the browser window already.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 12-14-2013, 02:05 PM   #8
PtcThatPays
 
Join Date: Dec 2013
Location: Denmark
Posts: 18
Default

Thanks guys.. You do make me think alot about what i should do here.

Looks like jQuery and some AJAX is the way to go.. More to learn then.

But the strange part is that i had a website 10 years ago where everything opened in the middle. Was a simply page but it was working.

And that was before Divs if im not wrong.. Just think its strange that it has gotten harder for me over the years.

The other website was on a pc that broke down so dont have it anymore but will find some good examples for you to look at to see what i mean.
PtcThatPays is offline   Reply With Quote
Old 12-14-2013, 08:55 PM   #9
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

If you say "i had a website 10 years ago where everything opened in the middle. Was a simply page but it was working." I think you're talking about a website build with frames/framesets and if so they're even worse.

10 years ago is 40 years ago in Internet years. Technology is going fast and what you want you can do much better today. Better for your users, the SE bots and yourself.

Here's a basic example using the history api. Click on the youtube vid so you can see that it keeps on playing while you click on navigation links and see the URL changing with it.
http://html5.gingerhost.com/

Browsers that don't support the new API (such as IE9 and below) will just fall back to normal full page loading

If you want the same effect, similar user experience, in these browser too, then you need to fallback on AJAX (hash banging). There are open source frameworks that can help you with that. You use history API in modern browsers and automatically serve AJAX to the older browsers.

I'm working on a site for client where I use this one.

https://github.com/devote/HTML5-History-API

There was a demo on the creators site, but he removed it... so if you really, really, want it I can sent you some set-up to play with. It does use PHP to solve the common deep linking issue what you also have when loading AJAX pages from sub-directories and for manipulating the meta tags in the head (title, description, or any tag you want for SEO), and it uses a .htaccess file for some URL rewriting. So you need some local server setup in order to play with it. WAMP for windows or MAMP for mac.

Let me know, but if you think this is way over my head then just stick to a traditional website, because normally you would use AJAX for content heavy websites or if you need to play simultaneously some kind of media in the browser too.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 12-15-2013, 01:37 AM   #10
PtcThatPays
 
Join Date: Dec 2013
Location: Denmark
Posts: 18
Default

Im not sure how it was build really as i bought it done. It just seemed easy to operate and make new subpages for. But i do know there was a script running in the background and i bet thats what made it so easy.

And i know time flies here online and im soo behind but im trying to catch up the best that i can. Just so much to learn at once really.

I dont even know what history api is and you mentioned that a few times so i have to look into that also.

The link you gave me is brilliant. I didnt know this was possible.

I will take a close look at both your links thats for sure.

And this is not a definitive no at all but for now i would have to say no thanks about sending me stuff sadly. I really want to learn myself as im hoping this can be a career at some point even though it seems hopeless right now.

But i appreciate all the help you are giving me. Thats time consuming enough for you really.

I look at alot of source codes at different sites and thats how im learning besides videos and books.

And i have a feeling this project its way over my head but not yours

It was soo simple in my head and when i drew it down on paper.

But do you have any advice for me at the moment about what to do next..?

Im using a danish site where they have some amazing tutorials and i startet out with HTML-HTML5-CSS-CSS3 in that order and the next in line is Javascript and jQuery. I think they have them in the order that best to learn. Atleast it makes sence to me.

P.s Your questionnaire on your site issent working.

Last edited by PtcThatPays; 12-15-2013 at 01:45 AM..
PtcThatPays is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.