Internal Links No Reload

GitHub Packagist Version GitHub Release Date

Install

composer require nearata/flarum-ext-internal-links-noreload:"*"

Update

composer update nearata/flarum-ext-internal-links-noreload:"*"
php flarum cache:clear

Remove

composer remove nearata/flarum-ext-internal-links-noreload
php flarum cache:clear

How it works

If a link in a post is found to be on the same base url (ex. 'https://discuss.flarum.org'), the default behaviour of the anchor tag is removed and when the user clicks on it, it will be managed by mithril routing system (like when you click on a discussion in the discussions list).

Links

    What is the purpose of the extension? does it speed up forum and makes less load on the server?

      almalino no, but prevent a complete page loading when u click an internal link posted into discussions

      Nearata

      Great extension.

      Would it be possible, to add the event handlers that lead to post previews like in mentions, so that [Nearata](https://discuss.flarum.org/d/26844/1) (Nearata) looks and acts similar to @Nearata#160300 (Nearata)?

        • [deleted]

        • Edited

        Hello this works great 👍 and never triggers reload in posts internal link but whenever I click below images link it triggers reload.......

        When click on welcome banner link or when click on mobile ui extension then it is triggering reload..

          Nearata Internal links in posts no longer trigger a page reload.

          [deleted] According to the description, the scope of this extension is limited to links in posts, and does not include links outside posts.

          • [deleted]

          Just a quick note - if you are using phenomlab/fancybox-wrapper please do not install this extension as it will render it inoperable 🙂

            18 days later

            [deleted] I tested this a bit and can't see any problem related with your extension. Probably i fixed it accidentally in version 1.0.2.

            Pollux I don't know if, personally, i want to support this, as what i want was simply a not reload. PR's are always welcome.

              • [deleted]

              Nearata I tested this a bit and can't see any problem related with your extension. Probably i fixed it accidentally in version 1.0.2.

              Thanks. Let me check. When did you commit last ?

                a month later
                • [deleted]

                Nearata is this extension compatible with the latest Flarum release ? I get the below when trying to install

                metabullet@vps:~/public_html$ composer require nearata/flarum-ext-internal-links-noreload
                Using version ^1.0 for nearata/flarum-ext-internal-links-noreload
                ./composer.json has been updated
                Running composer update nearata/flarum-ext-internal-links-noreload
                Loading composer repositories with package information
                Updating dependencies
                Your requirements could not be resolved to an installable set of packages.
                
                  Problem 1
                    - nearata/flarum-ext-internal-links-noreload[v1.0.0, ..., v1.0.2] require flarum/core >=0.1.0-beta.16 <=0.1.0 -> found flarum/core[v0.1.0-beta.16] but it does not match your minimum-stability.
                    - Root composer.json requires nearata/flarum-ext-internal-links-noreload ^1.0 -> satisfiable by nearata/flarum-ext-internal-links-noreload[v1.0.0, v1.0.1, v1.0.2].
                
                Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
                
                Installation failed, reverting ./composer.json and ./composer.lock to their original content.
                  • [deleted]

                  • Edited

                  Nearata Hi - there is still a conflict with phenomlab/fancybox-wrapper. As far as I can tell, the link when clicked does not even do anything other than simply redirect to the main site. An example of this can be shown here - https://metabullet.com/d/231-show-off-your-desktop

                  Go to the first image in the link, then click it. It'll just take you to the homepage.

                  I don't think there's anything I can do about this as far as my extension is concerned. Perhaps you could include an option to ignore the /assets folder ?

                  EDIT: in fact, it doesn't seem to work with any images even with phenomlab/fancybox-wrapper removed. It seems to work fine with images outside of the assets folder as can be seen in this link - https://metabullet.com/p/6-site-security

                  EDIT2 - For now, I've disabled this extension so that my images at least work 🙂 I know several users who want to use both of our extensions together (I'm one of them), so it'd be good if we can work this out.