Skip to content

Conversation

@AllenJB
Copy link
Contributor

@AllenJB AllenJB commented Oct 27, 2025

Fixes #205

Makes the id's generated for examples reset for each page (except where they have another manually assigned id).

ie. the first example on any page is always id="example-1", the second id="example-2" and so on (unless they have other id's manually assigned).

While hidden, these id's are often used for linking from articles, forums & Q&A sites around the web. Every time they change they break any links to a specific example.

An example of this can be seen on https://phpdelusions.net/pdo/fetch_modes#FETCH_BOUND - the bottom 2 sections of this article have links to specific examples, but these have long since broken due to the way id's are currently generated.

If you think there may be a better way to implement this (specifically where / how to implement the reset counter hook) please let me know.

@Girgias
Copy link
Member

Girgias commented Oct 30, 2025

Does it still properly generate the following page: https://www.php.net/manual/en/indexes.examples.php ?

@AllenJB
Copy link
Contributor Author

AllenJB commented Nov 1, 2025

Does it still properly generate the following page: https://www.php.net/manual/en/indexes.examples.php ?

No. Not currently. I'll look into this. Thank you for making me aware of it.

Edit: This is now fixed

@Girgias Girgias merged commit b9eb060 into php:master Nov 4, 2025
7 checks passed
@AllenJB AllenJB deleted the example-ids-page-specific branch November 4, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stabilize example IDs in HTML

2 participants