Querying Content

Topics: General
Apr 15, 2011 at 2:13 PM

If there's a topic/docs, please me know, I can't seem to find anything on this.

Is there a way to query content created via the UI? I know that in a module you could create routes and controllers and then it's up to you to handle. But if you're just using the UI, can one say

something like "/customers?lastname=smith" to display a subset of data?

Apr 15, 2011 at 2:49 PM

There is a Search function if that's what you're after.

You need to install and enable the following modules: Search, Indexing, and Lucene.

Then you can add a "SearchForm" widget to any zone of your layout. This will perform text queries against the index.

You can choose which custom fields participate in the indexing; and you can add indexing to ContentParts using the OnIndexing event in your Handler.

Apr 15, 2011 at 3:03 PM

How about something like:

Locations/zipcodes/90210

This is from an SEO/readbale POV. How would one translate that to a query using the buit-in tools? Can that be done?

Apr 15, 2011 at 3:25 PM

For that you'd just need to create your own Controller and appropriate Routes to drill down through whatever parts you have storing this information.

How familiar are you with MVC design pattern?

Apr 15, 2011 at 9:55 PM

That's what I work in ;)

This would have to be in a module, no? I don't see controllers save in the modules themselves.

Coordinator
Apr 15, 2011 at 10:10 PM

Yes, in a module, but if you are going to write one, you might as well go all the way and create a content part from code.