I'm building a theme and right now I have individual key:value sets and hard coded values in the theme-settings.php for setting up a front page slideshow. I would like to know if there's a way to setup an array in theme-settings.php for the form and have the number of slides be dynamic.

I have failed to find any examples of info files and theme-settings.php files that would include a setup for an array with a few default values to get the user started.

My objective is the themes setting form will have a 0 to many input for this data so the user can add and remove slides from the settings page rather than having to manually edit the theme-settings.php and theme.info.

I would like to have each slide in the array hold a string, image, url. I already have this hard coded in my theme-settings.php, but if I can let the user change all of this in the themes settings menu that would make life easy.

  • Can you please provide code of your theme settings as to how you are managing the slider now? – Bharat Sep 30 '17 at 10:07
  • I'm making a modded theme from drupal.org/project/nexus If you download nexus and look at the info file you will see what i'm talking about. the slides are hard coded. – Patrick W. McMahon Oct 6 '17 at 4:50

Your Answer

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

Browse other questions tagged or ask your own question.