Skip to content

Instantly share code, notes, and snippets.

@silentworks
Created September 3, 2012 09:07
Show Gist options
  • Save silentworks/3608022 to your computer and use it in GitHub Desktop.
Save silentworks/3608022 to your computer and use it in GitHub Desktop.
MODX Resource List with Type Ahead

Create a new Template Variable

Go to Input Options Tab

Change Input Type to:

  • Listbox (Multi-Select) - for multiple resource select
  • Listbox (Single-Select) - for Single resource select

In Input Option Values type: @SELECT `pagetitle` AS `name`,`id` FROM `[[+PREFIX]]site_content` WHERE `published` = 1 AND `deleted` = 0

In the options below set Enable Type-Ahead: Yes

@justinkv
Copy link

justinkv commented Jun 4, 2013

Thanks for this, works really well for larger sites. I made a slight change to the name field to match the way that the default resource list shows the ID in parentheses, since the site I'm using this on has pages with the same pagetitles (product names).

@SELECT CONCAT(`pagetitle`,' (',`id`, ')') AS `name`,`id` FROM `[[+PREFIX]]site_content` WHERE `published` = 1 AND `deleted` = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment