QWRealURL Module for Joomla!
What does it do?
Shows you the non-SEF URL when using Search Engine Friendly URLs (SEF) in Joomla.
This allows for easy creation of internal Joomla links that can be dynamically routed.
How to use this module
- Install the module.
- Configure the module how you want it, including making sure to publish it and enabling it on a page of your choosing.
- Load a page that has the module configured to display on it.
- You will now see the non-SEF version of your URL.
Notes
- None yet
Compatibility
QWRealURL is fully compatible with Joomla versions 3.x and 4.x.
License
QWRealURL is a Joomla module developed by QuantumWarp and released under the GNU General Public License.
Learn More
Visit the extension's software page at: https://quantumwarp.com/software/joomla/qwrealcrm
References
I used the following links and resources to build this module.
Joomla Routing
Real Joomla SEF
- https://gruz.ml/en/tech-blog/joomla-tips-and-tricks/13-how-to-get-real-joomla-url-from-a-sef-url.html - Very useful and had several methods for getting the non-SEF URL.
- https://stackoverflow.com/questions/990202/how-to-find-the-non-sef-url-whilst-sef-is-enabled-joomla-1-5
Joomla Router Ref:
- https://docs.joomla.org/J3.x:Supporting_SEF_URLs_in_your_component
- https://api.joomla.org/cms-3/classes/Joomla.CMS.Uri.Uri.html (JUri) - loaded/extended in order below
- /libraries/vendor/jooml/uri/src/AbstractUri.php
- /libraries/vendor/joomla/uri/src/Uri.php (New)
- /libraries/src/Uri/Uri.php
- https://api.joomla.org/cms-3/classes/Joomla.CMS.Router.SiteRouter.html (JRouter)
- /libraries/src/Router/Router.php (New)
Javascript - Copy to clipboard
With Javascript you cannot directly copy anything you want. The **select()*- function on works on items the user can select normally.
The workarounds on the internet work by creating an element that can be selected like a textarea, copy the required data into it, select and copy that data now in the <textarea> and then <textarea> is deleted.
I rendered the non-SEF URL directly into a hidden which i can unhide, select and copy to the clipboard and of course re-hide the element.
Input/Textarea direct
- https://www.w3schools.com/howto/howto_js_copy_clipboard.asp
- https://makitweb.com/how-to-copying-content-to-the-clipboard-with-javascript/
- https://www.w3docs.com/snippets/javascript/how-to-copy-the-text-to-the-clipboard-with-javascript.html (nice tutorial)
Workaround method for innerHTML etc..
- https://www.google.com/search?q=copy+inerhtml+to+clipboard+javascript&oq=copy+inerhtml+to+clipboard+javascript&aqs=chrome..69i57j0l5.7433j0j7&sourceid=chrome&ie=UTF-8
- https://davidwalsh.name/clipboard (this has both methods but using a third party library)
- https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
- https://stackoverflow.com/questions/44908329/copy-text-innerhtml-of-element-to-clipboard
- https://stackoverflow.com/questions/23048550/how-to-copy-a-divs-content-to-clipboard-without-flash
- https://jsfiddle.net/alvaroAV/a2pt16yq/
- https://techoverflow.net/2018/03/30/copying-strings-to-the-clipboard-using-pure-javascript/
- https://www.reddit.com/r/javascript/comments/7xx8y9/copy_to_clipboard_without_displaying_the_textarea/
Javascript References
Features
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Please report any bugs or features that you find so that they can be fixed. To get more details visit https://quantumwarp.com/software/joomla/qwrealurl
[1.0.0] - 2019-11-23
Initial Release
- Initial Release