Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Easy referring/navigation using # in a post

I've had this idea for a long time, but finally took some time off to write it.

Whenever you get a link to a post, it includes the #pid, which will make the screen jump down to the post.
Example can be shown here.

The #pid27346394 in the URL will make it jump down to post 27346394, which is the post ID.
The navigation is done like this:

PHP Code

<?php 
<a name="pid27346394" id="pid27346394"></a> 

A simple a-tag with a name will make it able to use #whatever is in the name-attribute to navigate with.

When people make huge threads, it would be a great idea to have this navigation. In their table of contents, they usually link to another post. Example can be found here.

The actual suggestion
Add a new tag, which will work as the master, and then you can link to it using the normal url-tag or simply send a link like you do now.
An example could look like this:

Code
[nav=quick]Some title[/nav]

That will create an a-tag with the name-attribute like so:
PHP Code

<?php 
<a name="quick" id="pid123"></a> 

pid123 would be replaced with the post ID of the post, just like it is normally. In this example, the post ID is 123.

To make a link, it would look something like this:
https://hackforums.net/showthread.php?ti...=123#quick

tid is the thread ID (unique number for each thread)
pid is the post ID from before.
#quick will nagivate to the [nav=quick] part I specified before.

Example
http://fiddle.jshell.net/9qLxA/5/show/#quick

Code on the page to navigate there is:
PHP Code

<?php 
<a name="quick"></a> 
Use #quick to navigate there.

Thoughts?
Great suggestion in my opinion, you have my full support.
This would help a lot with large threads.

100% agree with Mohatu.
(Dec 20, 2013 06:41 AM)+mK Wrote:  I'm not sure if I fully understand what you're saying, bare with me.

So basically, your suggestion is to add an anchor to direct people to, rather than directing them to only a post? That way, you can send people directly to what they're trying to look at?

If so, I don't think it's a terrible idea. I just think it would only be used in very large threads. D:

That's exactly what I mean.
Also linking to a page you're already on, but adding # to it, will make it jump immediately instead of opening another page and then jump.

I would consider making an userscript for it, but people without the userscript would see the tags and wouldn't be able to make the jump down.
That could be prevented with [color=transparent] though... But still.
This would be great for large threads with a table of contents. I highly support this.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by ๖ۣۜStarkApr 13, 2023 01:45 AM 4 147 Apr 13, 2023 01:45 AM
Last Post: ๖ۣۜStark
by SIM-3205632Jul 10, 2021 03:06 PM 6 196 Jul 10, 2021 03:06 PM
Last Post: SIM-3205632
by Yin YangNov 19, 2018 10:10 AM 1 95 Nov 19, 2018 10:10 AM
Last Post: Xerotic