0

I know this is a simple answer, but I can't remember the exact way to write an SQL query to use in a custom field for displaying a list of channels currently on the site. A Google search on the topic wasn't much help. Thank you!

(I am using Query Field to create a dropdown list of channel names, if that changes anything.)

1

If the site_id is 1:

SELECT channel_id, channel_name
FROM exp_channels
WHERE site_id = 1;

Getting the channel_id and ht e channel_name.

| improve this answer | |
0

Not exactly a direct answer to your question, but I have created a fieldtype that allows you to select channels. https://github.com/rsanchez/channel_select

Might be of use to you.

| improve this answer | |
  • Unfortunately that won't work, as I need a custom field and do not build those myself. – Alexa Lohmeyer Jul 29 '14 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.