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.)

2 Answers 2

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.

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.

1
  • Unfortunately that won't work, as I need a custom field and do not build those myself. Commented Jul 29, 2014 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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