Getting a list of cms tables in a drop down in a section
3 posts by 1 authors in: Forums > CMS Builder
Last Post: October 24, 2014 (RSS)
Hi - I need to get a list of "sections" to display in a drop-down list in a section. For example, I have a section called Main Nav which is a category section - I want to be able to allow the user to set this "page" on their site to be a listing page for a blog. I need them to enter the name of the table they are getting the list records from. Right now I have this as an entry field - I'd like it to be a selection list. That selection list would have to show the names of the cms tables available for the listing WITHOUT the cms_ prefix on them.
How can I setup the list field properly to show the list of cms tables available?
Thanks in advance and I'm sorry if this question has already been answered - I searched the forum and couldn't find it.
In case anyone else is looking for this:
SELECT DISTINCT(REPLACE(TABLE_NAME,'cms_','')) as shortName, REPLACE(TABLE_NAME,'cms_','') as altName
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'cms_%'
ORDER BY TABLE_NAME
Here's an even better answer to the same question asked two years ago....by me ;)
http://www.interactivetools.com/forum/forum-posts.php?postNum=2217858