By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,991 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

page linking

P: 8
hi all
i'm new to html and am looking to create page transfer links similar to the search engines where results span over one page,
you get a list like "1 2 3 4" etc where pages 2 onward are underlined and 1 (current page) is not and probably bold. on moving to another page, the underline shifts to 1. i would also like to include a 'next' and (after page 1) a 'prev' each side of the 'pages'
this so that any pages of products that spread over a single page can be accessed,the head page of the product group being called up in the main navigation bar
i have several books and have scanned through various entries in this forum but can find no reference to this type of thing
please help
thanks
Mar 14 '07 #1
Share this Question
Share on Google+
13 Replies


Expert 100+
P: 1,892
To do what you are talking about (Bread Crumbs) in HTML you would have to create each page manually. To make this dynamic you would need a server side scripting language such as PHP or ASP.

HTH,
Aric
Mar 14 '07 #2

P: 8
thanks for reply
have been looking at other sites that have this type of action - 'borrowed' the coding that appears but cannot get it to fully work on my pages - i can get '1','2' etc to work, sometimes the 'next' but never so far the 'prev' although it appears on the page.as aleady said am new to this but this does not appear to be site side scripting but included on the web pages - am i wrong in this?
Mar 15 '07 #3

Expert 100+
P: 1,892
thanks for reply
have been looking at other sites that have this type of action - 'borrowed' the coding that appears but cannot get it to fully work on my pages - i can get '1','2' etc to work, sometimes the 'next' but never so far the 'prev' although it appears on the page.as aleady said am new to this but this does not appear to be site side scripting but included on the web pages - am i wrong in this?
No you are not wrong with that assumption. There are tons of examples on the web on how to do this. Do you know any server side scripting? Like I said you can do this manually, but you will have to do it to every page. Google Bread Crumbs or Pagination and you should get some good results.

HTH,
Aric
Mar 15 '07 #4

P: 8
No you are not wrong with that assumption. There are tons of examples on the web on how to do this. Do you know any server side scripting? Like I said you can do this manually, but you will have to do it to every page. Google Bread Crumbs or Pagination and you should get some good results.

HTH,
Aric
hi aric
thanks again for replying
no i do not know any server side scripting, my intention was to do manual coding on each affected sheet. at present i only have a couple of web pages that spill over onto two sheets so the workload to do it is not too daunting.
the problem was that i could not find any references in my books on doing this type of thing. i think i may have worked out where my previous coding was going wrong, will be looking at it today to see if i'm right.
thanks
allan
Mar 16 '07 #5

P: 8
aric
further to my earlier posting - i have looked at coding, not what i thought so back to square 1
this is the coding, still having probs with 'prev' not working and not blue and now, in the 'next' coding with the bold 2 - it's become underlined
<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tbody>
<tr>
<td class=smalltext align=middle
<a class=pageresults title=" page 1 "
href="page2.htm">&nbsp;&nbsp;<b>1</b>&nbsp;&nbsp;
<a class=pageresults title=" page 2 "
href="page3.htm"><u>2</u>&nbsp;&nbsp;&nbsp;
<a class=pageresults title=" next page "
href="page3.htm"><u>[next&nbsp;&gt;&gt;]</u>
</td></tr></tbody></table>








<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tbody>
<tr>
<td class=smalltext align=middle
<a class=pageresults title=" previous "
href="page2.htm"><u>[&lt;&lt;&nbsp;prev]</u>&nbsp;&nbsp;
<a classresults title=" page 1 "
href="page2.htm"><u>1</u></a>&nbsp;&nbsp;
<a class=pageresults title=" page 2 "
href="page3.htm"><b>2</b>
</td></tr></tbody></table>
Mar 16 '07 #6

jhardman
Expert 2.5K+
P: 3,405
Try:
[html]
<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tr><td align=middle>
<a title=" previous "
href="page1.htm">[&lt;&lt; prev]</a>
<b>2</b>
<a title=" next " href="page3.htm">[next &gt;&gt;]</a>
</td></tr></table>[/html]
Hyperlinks are underlined by default, so you don't need to specify the underline (<u>underlined text</u>)
The class attributes, which I removed from your code sample, refers to a predefined styling which you should have within the page head:
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <style>
  3. a.pageresults {
  4.    (specific style of the <a class="pageresult">)
  5. }
  6. </style>
  7. </head>
  8.  
If you are not using any of that, the class=pageresults means nothing.

I would suggest also leaving the current page outside of any anchor tag (you had it inside <a>)

Does this help?

Jared
Mar 16 '07 #7

jhardman
Expert 2.5K+
P: 3,405
also, make sure every tag you start is finished, and remember that some tags are stand-alone, while others need end tags as well.

w3schools is a good resource if you want to look up correct syntax and usage.

Jared
Mar 16 '07 #8

Expert 100+
P: 1,892
aric
further to my earlier posting - i have looked at coding, not what i thought so back to square 1
this is the coding, still having probs with 'prev' not working and not blue and now, in the 'next' coding with the bold 2 - it's become underlined
<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tbody>
<tr>
<td class=smalltext align=middle
<a class=pageresults title=" page 1 "
href="page2.htm">&nbsp;&nbsp;<b>1</b>&nbsp;&nbsp;
<a class=pageresults title=" page 2 "
href="page3.htm"><u>2</u>&nbsp;&nbsp;&nbsp;
<a class=pageresults title=" next page "
href="page3.htm"><u>[next&nbsp;&gt;&gt;]</u>
</td></tr></tbody></table>








<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tbody>
<tr>
<td class=smalltext align=middle
<a class=pageresults title=" previous "
href="page2.htm"><u>[&lt;&lt;&nbsp;prev]</u>&nbsp;&nbsp;
<a classresults title=" page 1 "
href="page2.htm"><u>1</u></a>&nbsp;&nbsp;
<a class=pageresults title=" page 2 "
href="page3.htm"><b>2</b>
</td></tr></tbody></table>
I think what you are seeing is actually default behavior. A links default color is Blue once you click it you it probably turns purple you can only change this with CSS we can show you how no problem. If you are having trouble with the Previous you can try a nifty little Javascript trick that will take the user back one page. Let me know if you want to see an example.

Aric
Mar 17 '07 #9

P: 8
I think what you are seeing is actually default behavior. A links default color is Blue once you click it you it probably turns purple you can only change this with CSS we can show you how no problem. If you are having trouble with the Previous you can try a nifty little Javascript trick that will take the user back one page. Let me know if you want to see an example.

Aric
hi aric
i had assumed that the 'blue' was due to a hyperlink default but could not see why 'prev' was not blue when i specified a valid page address, it obviously did not show blue because it did not see the link as valid - but why?
if you could show me example of the java trick it would be appreciated
as i stated before this is 'borrowed' coding adapted to suit my page refs.
i have found that by taking out the 'next' and 'prev' coding i can get the plain '1' and '2' to work but it doesn't look as good and also restricts user operability
thanks for help
allan
Mar 17 '07 #10

P: 8
also, make sure every tag you start is finished, and remember that some tags are stand-alone, while others need end tags as well.

w3schools is a good resource if you want to look up correct syntax and usage.

Jared
hi jared many thanks for input - will try later
these bits of coding were 'borrowed' from another website where they appeared to work fine but after adapting to suit my page set up i could not get the 'prev' switch to work as if there is an invalid link - page2.htm is sheet 1 of the list,this list spills over to page3.htm - so on page2.htm i want display 1 in bold and 2 undelined and in blue ond the 'next>>' symbol, on switching to page3.htm the display should change to '<<prev' and 1 underlined and blue and 2 bold
i assume blue colour is default action for valid links so why is 'prev' not working?
Mar 17 '07 #11

jhardman
Expert 2.5K+
P: 3,405
hi jared many thanks for input - will try later
these bits of coding were 'borrowed' from another website where they appeared to work fine but after adapting to suit my page set up i could not get the 'prev' switch to work as if there is an invalid link - page2.htm is sheet 1 of the list,this list spills over to page3.htm - so on page2.htm i want display 1 in bold and 2 undelined and in blue ond the 'next>>' symbol, on switching to page3.htm the display should change to '<<prev' and 1 underlined and blue and 2 bold
i assume blue colour is default action for valid links so why is 'prev' not working?
blue color is default for unvisited link, purple for visited link, all links are underlined by default. The browser does not check whether a page exists until you click on it, so if the link is written right it will appear in blue whether or not the page to which it links actually exists. The reason your link looked like ordinary black text is that you had not written the link tag correctly. It took me a few minutes to find where you had gone wrong in your original code, and some of the early tags were not completed, which messed up later tags as well. Try this sample code (There are only two pages in the continuation, pages 2 and 3? Did I understand you right?)
[html]for the first page:
<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tr><td align=middle>
<b>1</b>
<a href="page3.htm"> 2 [next &gt;&gt;]</a>
</td></tr></table>

for the second page:
<table cellspacing=0 cellpadding=2 width="100%" border=0>
<tr><td align=middle>
<a title=" previous "
href="page2.htm">[&lt;&lt; prev] 1</a>
<b>2</b>
</td></tr></table>[/html]
Is that what you want? Notice a couple of things different from your code: I dont ever use the underline (<u>) tag since everything I want to be underlined (links) is underlined by default. I do use the bold (<b>) tag to specify when I want something enboldened (and also notice the </b> which finishes it).

The actual part that had broken your link was a previous tag which read[HTML]<td class=smalltext align=middle[/HTML] (notice there is no ">" to finish the tag. The browser didn't understand that your next link was a link because it interpreted the <a ... > tag to be the end of the <td ... tag)

Does that make sense?

Jared
Mar 20 '07 #12

P: 8
hi jared
thanks for coding correction - it appears to work fine as far as displaying what i wanted
one minor problem now - on first page it displays on left of page, on second page it displays on right of page
i.e. the align=middle appears to be being ignored in both cases
any suggestions please??
thanks
allan
Mar 20 '07 #13

P: 8
hi jared
thanks for coding correction - it appears to work fine as far as displaying what i wanted
one minor problem now - on first page it displays on left of page, on second page it displays on right of page
i.e. the align=middle appears to be being ignored in both cases
any suggestions please??
thanks
allan
jared
it's ok - found fault - on cutting previous code and pasting new i had removed a '>' from previous tag
all works fine now
thanks
allan
Mar 20 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.