Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Designing Index Page With Target, - the table instead of using frame
BuffaloHELP
post Aug 30 2005, 03:16 AM
Post #1


Desperately seeking "any key" to continue...
Group Icon

Group: Admin
Posts: 3,434
Joined: 23-April 05
From: Trap17 storage box
Member No.: 6,042



I have been reading up on search engine's ability to cache one's site and I realized that FRAME is something these search engines don't really like. You can read it on Google's search FAQ and just recently my page was cached by Yahoo after taking down my frame index page to no frame page. So here is what I would like to do and I would like you super coders help.

PHP seems to be the best choice since when using INCLUDE command my index page includes not only my three separate pages in one, but it helps to have content rather than showing only
HTML
<FRAMESET name=topFrame rows=68,* frameBorder=0 framespacing="0" border="0">
<FRAME name=treetop src="EN_treeTop.htm" noResize target="mainpage" scrolling="no">
<FRAMESET name=mainFrame cols=200,*>
<FRAME name=contents src="EN_Tree.htm" target="mainpage" scrolling="no" noresize>
<FRAME name=mainpage src="EN_intro.htm" scrolling="auto" noresize>
</FRAMESET>
as a main page.

This is how I had my page laid out. I designed it this way to resemble your regular Windows help familiarity navigation.
Attached figure 1.
user posted image

I had it this way so that the BOX 1 and BOX 2 were never reloaded when a selection from BOX 2 (a tree style expandable/collapsible menu) occurs and only BOX 3 will load the intended page. It was fine and it worked beautifully. But now, I would like to have this as PHP. This is how my index page's code is:
HTML
<html>
<?

include 'top.html' ;
include 'menu.php' ;
include 'main.html' ;

?>
</html>

I already have the PHP navigation menu made for BOX 2 but whenever I click on the link, it opens up in new page. Instead of using FRAME, I have those laid out as TABLE.

My questions are:
1)Is there anyway I can target the link to the BOX 3 using TABLE's command (like name="main") from menu click on BOX 2?
2)Could I still use JAVA coded menu.html (the original menu) instead of menu.php?
3)If TABLE isn't the answer, could you recommend me the right one?

For a working demo (not mine) please refer to http://www.esat.kuleuven.ac.be/~tvandera/phpmenu/ page and see the concept that I have in my mind. Except that I would like to refrain from using FRAMEs.

Thank you.
Go to the top of the page
 
+Quote Post
littleweseth
post Aug 30 2005, 08:14 AM
Post #2


Member [Level 2]
*****

Group: Members
Posts: 85
Joined: 27-August 05
From: QLD, Aus. G'day!
Member No.: 11,186



you mean 'it opens up in a new page' as in it loads a new page, or opens in a new *window*?

before we go on, a little pedantism : use <?php, not <?. <? is no longer supported.

Anyway, i believe the short answer is : no. Not without client-side scripting, like javascript, grabbing pages from your server and popping them into the 'content cell' of your template. If you still want to use javascript for you menu, btw, you can. You should be able to just whack the JS code into a separate file and include that, though i've never touched JS so i wouldn't know for sure. Google be thy friend and all that.

Anyway, the best you can do with a pure PHP layout/menu is to keep the state of your menu-tree alive using sessions, cookies, POSTdata or some combination of the above. Actually, this i cool because the menu keeps its state across browser sessions, if you like the idea of that.

Cookies aren't really hard (you just have to learn not to trust user data wink.gif) and the same applies for POSTdata.

As a further aside - why tables? You could instead use html DIVs and CSS for great justice, and so on. All you need is a little simple CSS even IE can understand. Try the following :

CODE
<style>
body {
 font-family :verdana;
}

#header {
 clear : both;
 width : 100%;
 border : 1px solid silver;
 background : #EEEEEE;
}

#menu {
 float : left;
 width : 29%;
 
 border : 1px solid silver;
 background : #EEEEEE;
}

#content {
 float : right;
 width : 70%;
 
 border : 1px solid silver;
 background : #EEEEEE;
}
</style>

<body>
<div id="header">
<h1>This be muh header, dook dook dook mook.</h1>
</div>
<div id="menu">
<h2>Menu</h2>
Menu Item <br>
Menu Item <br>
Menu Item <br>
Menu Item <br>
Menu Item <br>
Menu Item <br>
</div>
<div id="content">
Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.
</div>
</body>
Go to the top of the page
 
+Quote Post
Saint_Michael
post Aug 30 2005, 08:33 AM
Post #3


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,304
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



i would have to agree no matter how you slice it using frames won't give the search optimization your looking for.


but to answer your question use the
CODE
target=main
in your url and that will open it in the same page without opening a new window.


but yeah its better to do it in window and not in frames, yeah it will be messy but if you use external php files you won't be dealing with all the coding in one editor.
Go to the top of the page
 
+Quote Post
palladin
post Aug 30 2005, 08:39 AM
Post #4


Member [Level 3]
******

Group: Members
Posts: 92
Joined: 28-June 05
Member No.: 8,782



Lol i hate using DIV for make areas on whole page, this is always broke and doing strange things. I prefer tables smile.gif So try this

CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
   <td colspan="2"><?php include('top.html'); ?></td>
 </tr>
 <tr>
   <td width="30%"><?php include('menu.php'); ?></td>
   <td width="70%">
<?php
if ( isset($HTTP_GET_VARS['news'])) {include('main.html'); }
else if ( isset($HTTP_GET_VARS['page1'])) {include('page1.html');}
   else {include('wrongpage.html');}
?></td>
 </tr>
</table>
</body>
</html>


and you can put to you navigation menu links like:

http://yourpage.com/?news
http://yourpage.com/?page1

Go to the top of the page
 
+Quote Post
rvalkass
post Aug 30 2005, 10:20 AM
Post #5


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,052
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



I recently tried to do the same thing with my site. Its still being tested (hence the name test.php), but it works by being based entirely off of the index page, calling other pages only when they are needed. For example, clicking the Mailing List link opens the mailing list page in the middle section, but nothing else reloads or changes.

I am using div's on the main page, with the central div containing some code to load the right files. If its the kind of thing you're looking for then I'll be happy to give you the code and help you out.
Go to the top of the page
 
+Quote Post
Tyssen
post Aug 30 2005, 12:26 PM
Post #6



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



If you look at a site I did - Pure GRiT - there is only actually one PHP page that calls in the rest of the content from includes (based on what is in the querystring) so it kinda mimics the way frames work (notice that the background & header never actually move).
Go to the top of the page
 
+Quote Post
Saint_Michael
post Aug 31 2005, 01:21 AM
Post #7


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,304
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



i think thats what buffalo is look for on the grit website,


how could the <div> tag break up unless the CSS script doesn't load up properly thats all i could think of for that to happen.
Go to the top of the page
 
+Quote Post
littleweseth
post Aug 31 2005, 06:16 AM
Post #8


Member [Level 2]
*****

Group: Members
Posts: 85
Joined: 27-August 05
From: QLD, Aus. G'day!
Member No.: 11,186



Heh - div's even behave at school in IE6.

The only reasons div's shouldn' work are if you've done something funky with the nesting of tags, the stylesheet is lost in the mail or the browser you're on suxoring. Div's have been around for a long time though, so they should damn well work even in IE 4.
Go to the top of the page
 
+