Logo
View unanswered posts | View active topics It is currently Sat Dec 16, 2017 6:26 pm



Reply to topic  [ 6 posts ] 
Anchor links 
Author Message
Malekith's Best Friend
User avatar

Joined: Fri Oct 03, 2003 7:36 pm
Posts: 3831
Location: Belgium, Brussels
Greetings,

I stumbled on this on the D.R.A.I.C.H topic, but it was impossible to make a table of contents using links to anchor points. I'm not sure if we need support to make named links (anchors) since every post already recieves one from the system. But it would be practical to support linking to them.

There is no coding, mod or extension needed for this.

This topic describes how to do achieve this, using native functionality:
https://www.phpbb.com/community/viewtopic.php?p=7216175

It would be nice to be able to refer to other posts on the same page without having to relead the topic and page.

Cheers,
Daeron

_________________
I love me a bowl of numbers to crunch for breakfast. If you need anything theoryhammered, I gladly take requests.

Furnace of Arcana, a warhammer blog with delusional grandeur.

"I move unseen. I hide in light and shadow. I move faster than a bird. No plate of armour ever stopped me. I strike recruits and veterans with equal ease. And all shiver at my coldest of whispers."
- The stiff breeze


Mon Nov 12, 2012 9:38 am
Profile WWW
Malekith's Best Friend
User avatar

Joined: Fri Oct 03, 2003 7:36 pm
Posts: 3831
Location: Belgium, Brussels
This functionality is now supported.

People can use the following code to create an anchor:

Code:
[anchor]name_of_the_anchor[/anchor]


And then create a "goto" link to the anchor as such:
Code:
[goto=name_of_the_anchor]Link to another point in the post.[/goto]


Note that the "#" sign is not required in the name. This is provided by the forum.

For example, you can jump back to the anchor code or the original request with this, without having to reload the page.

_________________
I love me a bowl of numbers to crunch for breakfast. If you need anything theoryhammered, I gladly take requests.

Furnace of Arcana, a warhammer blog with delusional grandeur.

"I move unseen. I hide in light and shadow. I move faster than a bird. No plate of armour ever stopped me. I strike recruits and veterans with equal ease. And all shiver at my coldest of whispers."
- The stiff breeze


Tue Sep 24, 2013 10:24 am
Profile WWW
Morathi's Best Friend
Morathi's Best Friend
User avatar

Joined: Tue Oct 04, 2005 5:06 pm
Posts: 1201
Location: Flanders, Belgium
Silly question: what happens when two posts on the same page view use the same anchor names? Is this changed behind the scenes to make them unique (but how would linking work)? Will they stay the same and let the browser sort it out?

I was thinking of using this for the SAU. Some of my posts can be large, and anchors could be useful to link directly to results at the bottom. And being the confused lazy git that I am, I was wondering whether I'd need to use different anchors for different posts.

Also: yay, anchors! :D

_________________
SAU XV: Pawn of the Dead | SAU XVII: The Frosty Dozen | SAU XIX: On the Brink of Madministration | Running fiction: House Arhakuyl


Tue Sep 24, 2013 11:43 am
Profile
Malekith's Best Friend
User avatar

Joined: Fri Oct 03, 2003 7:36 pm
Posts: 3831
Location: Belgium, Brussels
Interesting questions. There's nothing to prevent the same post, let alone page, to generate the same anchor. How this is treated, would then depend on the browser's behavior. You have to use a unique anchor if you want to be sure.

What exactly is it you want to do? To have a general link in the first post and have it automatically link to the latest results?
Or will you be posting a new link in the same or a new post every time?

In the former case, we'll have to add new functionality to the forum. I'm not sure how it can be done "the easy way" yet. For the latter, it might be interesting to use a lazy trick: just add a day+month code in front.
Like:
Code:
[anchor]0924results[/anchor]

And then a goto can be:
Code:
[goto=0924results]The latest results[/goto]


I could note that phpBB3 and this template we're using already generates a few interesting anchors:
- One per post, but the "id" of the post is only known after the message is posted. Still you can use it. For example, your post has id "874968". the anchor for it is "#p874968". And so I can link to it without needing to edit your post.
- A "top" anchor, to get back to the top of the page.
- An "unread" anchor, to get to the first unread post of the topic.

We could also code in a few extras should they be useful, such as:
  • "latest post"
  • Bottom of the page

_________________
I love me a bowl of numbers to crunch for breakfast. If you need anything theoryhammered, I gladly take requests.

Furnace of Arcana, a warhammer blog with delusional grandeur.

"I move unseen. I hide in light and shadow. I move faster than a bird. No plate of armour ever stopped me. I strike recruits and veterans with equal ease. And all shiver at my coldest of whispers."
- The stiff breeze


Tue Sep 24, 2013 1:00 pm
Profile WWW
Morathi's Best Friend
Morathi's Best Friend
User avatar

Joined: Tue Oct 04, 2005 5:06 pm
Posts: 1201
Location: Flanders, Belgium
Oh no, nothing that serious or organised.

The posts are structured like this:

  • Story so far
  • Separator line
  • Game information at that time, such as current votes, players in the game, and so on

Because these story parts can span several screens, I feel a bit silly linking to the post as a whole when I'd like to highlight the game information, which appears at the very bottom.

Obvious workaround: put this information at the top instead of at the bottom, but I've put the story on top for eight years now, and it feels weird to do it differently. Also, having the story on top neatly cordons off the different parts of the game (dawn, morning, noon, evening, dusk, night), and people have to scroll up a lot less to see the important bits.

Other obvious workaround: split into separate posts. I just know I'll muck this up spectacularly at one time or another. Don't ask me how; I'll find a way. I always find a way.

I was going to do what you now suggested: simply use a suitable prefix, like #day-1-dusk or #evening-4-1, and so on. But I was thinking I could get away with just letting my text editor insert some automatic anchor. :P Instead I'll have to (gasp) think for a moment.

If you see rust and gears spraying around, that's my brain having at it. Just stay indoors for a bit.

Must not... overthink... solution...!

_________________
SAU XV: Pawn of the Dead | SAU XVII: The Frosty Dozen | SAU XIX: On the Brink of Madministration | Running fiction: House Arhakuyl


Tue Sep 24, 2013 2:11 pm
Profile
Malekith's Best Friend
User avatar

Joined: Fri Oct 03, 2003 7:36 pm
Posts: 3831
Location: Belgium, Brussels


If the goto and anchor are within the same post, I wouldn't mind developing code to make this possible, such that you can reference to anchor points within the same post. It's certainly worth increasing the comfort of users that have been with us for 8 years ;)

TO start

_________________
I love me a bowl of numbers to crunch for breakfast. If you need anything theoryhammered, I gladly take requests.

Furnace of Arcana, a warhammer blog with delusional grandeur.

"I move unseen. I hide in light and shadow. I move faster than a bird. No plate of armour ever stopped me. I strike recruits and veterans with equal ease. And all shiver at my coldest of whispers."
- The stiff breeze


Tue Sep 24, 2013 3:40 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software