- AdvSearch
- cookieJar
- getYoutube
- aliasid
- AddHeaderfiles
- AjaxUpload
- amazonSES mailing list
- Analytics
- Archivist
- Articles
- Babel
- BannerX
- BannerY
- Batcher
- bdListings
- boilerX
- BreadCrumb
- Breadcrumbs
- BxrExtra
- cachebuster
- CamperManagement
- Church Events Calendar
- Cliche
- ClientConfig
- CMPGenerator
- Collections
- ContextRouter
- CookieList
- CronManager
- cssSweet
- CustomUrls
- Databackup
- Discuss
- DitsNews
- Eletters
- EventManager
- eventsCalendar2
- EventsX
- ExerPlan
- fastField
- FileDownload R
- FileLister
- FirstChildRedirect
- Flexibility
- ForcedPasswdChange
- FormIt
- FormIt2db
- FormitFastPack
- FormSave
- FoundationX
- FX2themebase
- Gallery
- GatewayManager
- gCal
- getDate
- getFeed
- getPage
- getRelated
- getResourceField
- getResources
- getUrlParam
- getRTImages
- getVimeo
- GoogleSiteMap
- GridClassKey
- HandyMan
- Hits
- HitsPage
- HybridAuth
- If
- Image+
- imageHERE
- ImageStyles
- ImportX
- LexRating
- Lingua
- Login
- Loginza
- mChimpX
- MetaX
- mhPayPal
-
MIGX
- MIGX.Backend-Usage
- MIGX.Data-Entry
- MIGX.Frontend-Usage
-
MIGX.Tutorials
- MIGX.Fancybox-images with seperate placeholders in Richtext-Content
- MIGX.Simple opening hours table
- Using resource-specific mediasource and multifile-uploader with MIGX
- MIGX.Varying layout-boxes
- Creating Selectable and Sortable lists for MIGX
- MIGX.sortable resourcelist
- Using resource-specific mediasource and multifile-uploader with MIGX
- MIGX.Using Grid Inline Editing
- MIGXdb
- MinifyX
- miniShop
- modActiveDirectory
- ModDef
- modExtra
- modMobile
- modSwiftMailer
- mxCalendar
- mxExtendedMenu
- mxFormBuilder
- mxHasTvs
- MoneyBird
- ObfuscateEmail-Revo
- PackMan
- PageBreaker
- Peoples
- PHP Tidy (plugin)
- phpThumbOf
- Polls
- POI Manager
- QuickCrumbs
- Quip
- Rampart
- Redirector
- renderResources
- ResourceWatcher
- RezImgCrop
- Rowboat
- sekFancyBox
- sekFormTools
- sekSiteTools
-
sekUserGalleries
- sekUserGalleries.album.items.helper
- sekUserGalleries.album.items.manage
- sekUserGalleries.album.manage
- sekUserGalleries.album.view
- sekUserGalleries.browse.galleries
- sekUserGalleries.directory
- sekUserGalleries.image.information
- sekUserGalleries.search
- sekUserGalleries.users.gallery.manage
- sekUserGalleries.users.gallery.view
- selfLink
- Shopkeeper
- siblingNav
- SimpleSearch
- SiteEditor
- sitemapFriend
- Slideshow Manager
- sLink
- SmartOptimizer
- SmartTag
- StatCache
- SocialLogin
- SocialSuite
- spieFeed
- StaticSaver
- StoreLocator
- SubscribeMe
- SyntaxChecker
- Tagger
- TaggingAtoZ
- tagLister
- TinyMCE
- Upload to Users CMP
- VersionX
- virtuNewsletter
- VisionCart
- Wayfinder
- xFPC
aliasid
Created by Robert Ross on Jan 29, 2014.
What is aliasid?
aliasid is a MODX Revolution Extra that gets and returns the Resource ID by querying the alias of the resource. It is especially useful in multiple context installations that share the same structure and same snippets.
Requirements
- MODX Revolution 2.2.x+
- PHP 5.3
History
aliasid was written by Michael Graham.
Download
aliasid can be downloaded from with the MODX Revolution manager via Package Management or from the MODX Extras Repository, here:
GitHub
aliasid is stored and developed in GitHub, and can be found here:
Usage
Imagine you have a MODX install that runs a number of sites that are identical in function and features, but have different content, such as different addresses, languages, images, etc. Each of your sites has an "Events" list which displays an event title, date, location, and a link listed on the home page, using getResources.
Typically your getResources call includes a Resource ID defined with the parents parameter:
[[!getResources? &parents=`5` &tpl=`eventListTPL`]]
When you duplicate a context the Resource ID of the Events Resource for that context will have a different ID. aliasid dynamically retrieves the Resource ID number by querying the alias of a Resource within the current context. For example:
[[aliasid? &alias=`events/`]]
Gets and returns the Resource ID of the Resource in the current context that has an alias of events/.
In our getResources call, rather than specifying the ID by number we use the aliasid call instead:
[[!getResources? &parents=`[[aliasid?&alias=`events/`]]` &tpl=`eventListTPL`]]
Now this call will work in all the contexts as long as the correct Resources has an alias of events.
Note: Be aware that in some cases, when duplicating a context, some of the aliases are changed automatically.
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).