-1

The theme I am using has a slider -- a panel of automatically changing images to display a topic that the user can choose -- but it only shows a few slides. I want to extend it to a dozen slides. I did simple text searches to determine which files in the theme are used code files to provide the functionality to the slider. That was the easy part. I was able to extend the code from the few slides to 12 slides.

Now comes the more difficult and hidden part. As I see it, each slide has two parts that are not hardcoded. First, each slide has a caption -- a text description. Secondly, each slide has a URL associated with it that is where the browser goes if the user clicks on the slide. These two things are not hardcoded in any of the PHP or other files, as far as I can tell. They can be edited by the admin in the Drupal backend admin settings.

So I assumed that these fields are somehow set and retained in the database. But I did a search on a downloaded copy of the database and I did not find this text.

Please advise. What additional work do I need to do to complete this task?

I suppose I could just forge ahead. Obviously, this data is being stored somewhere. Maybe they are stored in the database in an encrypted form for security reasons. I could do an FTP upload of the site theme files. But then what? Do I uninstall the theme and then reinstall it? Do I just deactivate it and then reactivate it? How do I make my code changes work?

The theme is called "impact_theme" and as far as I can tell all the code for it resides in

sites\all\themes\impact_theme

The README.txt file for the theme is:

About Impact Theme
====================
Impact Theme is a Drupal 7 theme. The theme is not dependent on any
core theme. Its very light weight for fast loading with modern look.
  Simple and clean design
  Drupal standards compliant
  Implementation of a JS Slideshow
  Multi-level drop-down menus
  Footer with 4 regions
  A total of 10 regions
  Compatible and tested on IE7, IE8, IE9+, Opera, Firefox, Chrome browsers

Browser compatibility:
=====================
The theme has been tested on following browsers. IE7+, Firefox, Google Chrome, Opera.

Drupal compatibility:
=====================
This theme is compatible with Drupal 7.x.x

Developed by
============
www.devsaran.com

Slideshow photos by http://www.flickr.com/photos/68666702@N00/

Help and Support Us
=====================
Please consider a small donation
Paypal ID : donation@devsaran.com

============================================================================

I made a subtheme according to this page: https://www.drupal.org/docs/7/theming/creating-a-sub-theme.

I logged in to the Administrative Dashboard and I made the subtheme as the default theme.

And then the website immediately crashed and I am unable to see anything apart from "HTTP ERROR 500".

What do you think I should do now?

For completeness sake, I will list here the screenshots I made when I was comparing my modifications to the original theme.

I am thinking what I should do now is try to step back and see if I can narrow down the point where the website crashes. But in order to do that, I wonder if it will do any good to just modify the files. I mean, the subtheme is already set as the default theme. How can I undo that without being able to log into the Admin Dashboard?

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Yogi
  • 609
  • 1
  • 8
  • 21
xarzu
  • 8,657
  • 40
  • 108
  • 160
  • 2
    i'd suggest don't do everything at once, check first if the theme you're using contains documentation, maybe you don't need to edit the actual PHP file that does the slider, maybe there's just a simple setting in the admin panel that you need to change, maybe there's a settings like "number of slides to show", and just change it from there – Kevin Apr 17 '18 at 02:29

1 Answers1

0

First, slides are stored in theme settings, so you should go to Appearance -> Your Theme -> Settings to edit them. That's however not very good way to store the variables that shouldn't have definitive number of values. Also slides are more site content then theme settings.

I would define new content type called "Slide" or something, add all the values one slide needs (picture field, description, link...) and use the View to collect those values - loop over them. That way you can have any number of slides. You can also add some field for ordering slides etc. Also, I wouldn't use picture field directly (to display image uploaded by admin), but I would add image style for slide, to scale that image to proper dimensions. That makes life much easier for admin - he doesn't have to use some image editing tool to scale each image manually. That's my suggestion - what I would do.

Second, site is "made" of files and database, so any content it displays must be in one of those two parts.

And third, start from just inheriting the them and see will it work and then change it step by step, so you can notice easier what causes the problem. Also if base theme is not public one (it won't get updates and so) you can change it directly.

And about error 500 - error can be logged or displayed. Run phpinfo() to see where is php.ini file. Edit it and allow at least error login. Or for you development environment even better allow error displaying.

MilanG
  • 6,994
  • 2
  • 35
  • 64