Skip to content

file and folder pages behave in an unexpected manner #108

Open

Description

@Qrbaker

Page names with and without trailing /, like https://wiki.openttd.org/en/Manual/ and https://wiki.openttd.org/en/Manual (note the trailing "/") do not resolve to the same page. This breaks navigating up hierarchies.

Activity

  1. TrueBrain commented on Mar 22, 2021

    @TrueBrain
    Owner

    I am not completely sure what you mean, as you are a bit minimalistic with the ticket :) But how TrueWiki sees the world:

    Everything ending on a / is a folder. Everything else is a file request.
    A folder request, internally, is rewritten to a file request by appending Main Page to it (basically the index.html variant of what most HTTP servers do). This because we cannot render folders, only files.
    (well, there are a few exceptions, mostly / is an exception, but okay; minor details :D).

    So those two URLs, according to TrueWiki, are indeed not the same, and shouldn't be the same. /en, the page, doesn't exist. /en/ internally is rewritten to /en/Main Page which is rendering /Page/en/Main Page.mediawiki from the filesystem, which does exist (most likely).

    What I am not sure about, is why you wrote this ticket; what is going wrong exactly?

    What do you mean with "This breaks navigating up hierarchies.". Does TrueWiki render broken breadcrumbs in the top navigation? There should never be a link to /en generated by TrueWiki, only to /en/. Did you find somewhere this not being the case?

    Or is this because you have the expectation TrueWiki redirects /en to /en/ automatically? In that case I wonder why this is your expectation and when one would hit /en?

    Or is there something else behind this ticket?

    All honest questions, to be clear :) Really curious about the motivation behind this question :) Tnx :)

  2. Qrbaker commented on Mar 23, 2021

    @Qrbaker
    ContributorAuthor

    The issue is visible on our staging wiki. We made a top-level page called "Web Console" and nested some other info in Web Console/:

    The top level directory UI made me think I could click on the folder name to go back to the top page.
    image

    If what you say is true, should https://crafty-wiki.silverfyre.info/en/Web%20Console/ then redirect to https://crafty-wiki.silverfyre.info/Folder/Page/en/Web%20Console/ ?

    I guess I would suggest allowing folders to have wikitext associated with them, like how image files can also have .mediawiki files for text, or looking at changing the directory style.

    I suppose we can just re-architect our file directories to make a new top-level folder and put the parent and child pages in it at the same level. Or should we move the en/Web Console page to en/Web Console/Main Page?

  3. Qrbaker commented on Mar 23, 2021

    @Qrbaker
    ContributorAuthor

    I think I have it figured out. I moved the page to en/Web Console/Main Page and the hierarchy works as expected. This came down to an issue with the page creation process, which doesn't make it clear that you need to preemptively make a page name like this if you intend to nest pages under it later.

    I don't know the feasibility, but it would be nice to perhaps have an option to "add a sub-page" when on the edit screen, or next to the edit button, that moves the page to a folder main page and then redirects to the new page.

    Although this would mean any links to said page would then break...


    If you wish, I can close this issue as the immediate problem has been resolved. I'd want to make a feature request to track this in that case, while I look at a solution.

  4. changed the title [-]Urls with trailing /s are not equivalent to ones without[/-] [+]file and folder pages behave in an unexpected manner[/+] on Mar 23, 2021
  5. TrueBrain commented on Mar 23, 2021

    @TrueBrain
    Owner

    Just to confirm I understand you correctly:

    You expected that en/Web Console would be the "root" of en/Web Console/, so that if you visit the latter, you see the content of the first?

    I can understand that; we introduced folders in a different way (as you found out by now), but I get where that idea comes from. When you hit Create Page on en/Web Console/ the first time, it does add Main Page to it, making the suggestion how it works. But I agree you need knowledge of how folders work in order for you to understand that part.

    If you would make en/Web Console/Logs first, clicking on the hierarchy will give you a Page Not Found for en/Web Console/, but hitting Create Page there allows you to make the right page.

    But when you come from the other direction, first make en/Web Console and afterwards think: I want to make this a folder and have subpages, it breaks a bit.

    I too need to think about this. I guess once you know, you know, but a bit of hinting how folders work wouldn't hurt anyone. Interesting :D

  6. Qrbaker commented on Mar 24, 2021

    @Qrbaker
    ContributorAuthor

    Yeah, I was coming at it from a mediawiki perspective I suppose. The common case of nested pages on mediawiki sites are userpages. A user will have their User:username page, and might make, say, a User:username/sandbox page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions