View Full Version : Wiki Style Content Links
iGoD ReLeNtLeS
26-05-10, 00:38
Right i never really got much help on this over at NT, so i'll try here. I can do basic HTML, or at least the bits i need to know for basic web dev, but i never sussed being able to have a link like wiki where you can redirect to a section of the page.
i.e:
Contents
1
1.1
1.2
2.0
2.1
etc where each link will go to a section of the page rather than having several pages on the same topic.
if we look at the wiki source page we get: (stolen from E.A page (http://en.wikipedia.org/wiki/Electronic_Arts))
{span class="toctext"}Company Structure{/span}
thats as far a i know, would someone care to shed some light please.
Many Thanks TTG/iGoD
InvaderGIR
26-05-10, 00:40
Is it something to do with the div tags? Not done much HTML for a while to be honest.
Mr. Grapes
26-05-10, 00:46
they're bookmarks, marked by id
from the EA page:
span class="mw-headline" id="Criticism"
it's the id="Criticism" so that if you go to http://en.wikipedia.org/wiki/Electronic_Arts#Criticism
it's the #criticism part that takes you there.
edit... Ok I don't know how to disable html parsing so I've left out the < and >
iGoD ReLeNtLeS
26-05-10, 00:49
Is it something to do with the div tags? Not done much HTML for a while to be honest.
I dont think so, the only div tags i can find is the ones that create the "contents box" and nothing that links to a div tag either. I would copy and paste the code, but google chromes 'inspect element' feature doesn't allow for it.
EDIT: So {span class="Secondary Header" id="About_Me"}About Me{/span} then link as .../index.html#About_Me
thats it?
in 'old' school html, they are called anchor tags and are very simply referenced as such, if you lookup anchor tags you will find that the more commonly known href is actually an achor tag of type hyperlink :)
{a name="reference1"}{/a}
now to place a link on that page that will go to the point in the source
{a href="#reference1"}Jump to anchor point named reference1{/a}
DT.
Mr. Grapes
26-05-10, 10:48
oh yeah, that's it.
a href="#Criticism"
it's been so long since i did this I picked up the wrong bit.
but yeah, a href="#{some text}"
iGoD ReLeNtLeS
26-05-10, 11:33
in 'old' school html, they are called anchor tags and are very simply referenced as such, if you lookup anchor tags you will find that the more commonly known href is actually an achor tag of type hyperlink :)
{a name="reference1"}{/a}
now to place a link on that page that will go to the point in the source
{a href="#reference1"}Jump to anchor point named reference1{/a}
DT.
Thanks buddy, took a month and we didnt even get anywhere close to it last time :) Thanks again
Thanks to you as well grapes, nothing like late night help ;)
P.S: Loving this thanking stuff, a lot easier than using the rep system, which would never get used.
EDIT: Thanks guys, works a treat, glad i got that done with :)
Mr. Grapes
26-05-10, 13:20
Thanks to you as well grapes, nothing like late night help ;)
too hot to sleep.... too tired to get the right bit of code :coffee:
Just remember that anchors need to start with an alphabetical letter. Took me some banging the head against the desk some years back while I tried to work out why I couldn't links posts simple as '#1', '#2', etc etc but needed to use something like '#post_1', '#post_2' :)
Regards,
Ian
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.