Empty Alias Snippet Tutorial
If you use this extra and like it, please consider donating. The suggested donation for this extra is $5.00, but any amount you want to give is fine (really). For a one-time donation of $50.00 you can use all of my non-premium extras with a clear conscience.
Utility snippet for MODX Revolution to report and fix Resources with empty aliases
Fully updated for MODX 3
Honestly, there's not much use for this extra anymore, since it's now fairly difficult to create a resource with an empty alias, even in code. The only use cases I can think of are updating an older version of MODX that has empty resources with empty aliases, or accidentally removing the alias while editing a resource in PhpMyAdmin.
That said, if there are resources with empty aliases, this snippet will now fix them in both MODX 2 and MODX 3.
Installing EmptyAlias
Go to Extras > Installer on the main menu in the MODX Manager and click on the "Download Extras" button. That will take you to the Revolution Repository. Put EmptyAlias in the search box and press Enter. Click on the "Download" button. When the download finishes, click on the "Back to Package Manager" button. That should bring you back to your Package Management grid. Click on the "Install" button next to EmptyAlias in the grid. The EmptyAlias package should now be installed.
Usage
To check for, and fix, empty aliases (if any), just view the EmptyAlias Resource.
My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book may still be available from Amazon.
If you have the book and would like to download the code, you can find it here.
If you have the book and would like to see the updates and corrections page, you can find it here.
MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:
- Installing MODX
- How MODX Works
- Working with MODX resources and Elements
- Using Git with MODX
- Using common MODX add-on components like SPForm, Login, getResources, and FormIt
- MODX security Permissions
- Customizing the MODX Manager
- Using Form Customization
- Creating Transport Packages
- MODX and xPDO object methods
- MODX System Events
- Using PHP with MODX
Go here for more information about the book.
Thank you for visiting BobsGuides.com
— Bob Ray