• Better alias path handling#

  • gerritvanaaken Reply #1, 1 year, 7 months ago

    Reply
    Of course MODx supports friendly URLs and ressource aliases. But the "alias path" handling is poor. If turned on, the web developer faces several problems:

    * Wayfinder links are broken on 2nd-level pages and above, because they render no leading slash. You have to manually modify the Wayfinder templates and add a / before every href value.
    * Same goes for several other add-ons
    * The leading slash is not rendered by the
    <a href="[[~42]]">Internal link syntax</a>
    . You must write it
    <a href="/[[~42]]">this way</a>

    * The official reference tells you to use <base href="/"> to fix those problems (http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs ) Well, this is kind of old-fashioned. And it does not work with internal anchor jump links (They lead to the start page). It’s a lame solution :-(

    It is important to have not only friendly, but also semantically correct URLs - and MODx should offer a less complicated way to use nested URL schemes.


  • chucktrukk Reply #2, 1 year, 5 months ago

    Reply
    I really like the idea of adding the site_url in front of the url when parsing.

    Is there any real good reason not to?

    It would keep us from having to create a plugin to get #targets to work.


  • Mark Hamstra - MODX Complete Team Reply #3, 1 year, 5 months ago

    Reply
    makeUrl has a scheme parameter which can be used to automatically prefix the link with the site_url or base_url. (see http://rtfm.modx.com/display/revolution20/modX.makeUrl )

    I think you could use this:

    to force it to use that scheme.


    Perhaps a concrete suggestion to improve alias path handling is a system setting you can use to determine the default scheme makeUrl uses. That way you can choose to use relative paths and base href, or use absolute paths and don't have to bother about it.

    As far as I can imagine right now, that would be as simple as making the makeUrl function check the system setting and base the default behaviour on that. I think the default should stay what it is now though, as most websites have probably accepted it the way it was and worked around it. So then an upgrade would break it.


    ( Bug report about this: http://bugs.modx.com/issues/2726 )


  • krisj Reply #4, 11 months, 3 weeks ago

    Reply
    so, i see the bug has not been fixed... in fact the status says something along the lines of "deleted" huh?


  • Mark Hamstra - MODX Complete Team Reply #5, 11 months, 3 weeks ago

    Reply
    To me it says "Feedback"? Not sure what you're looking at.


  • lluuuk Reply #6, 6 months ago

    Reply
    Got also the issue with the jumplinks...something like
    <a href="#sectionjumpto">Jump</a>
    won't work...is there a way to solve this?