lost link

Events happening in the community are now at Drupal community events on www.drupal.org.
fchandler's picture

The site I have been working on was copied closer to going public. The css file in my Fusion sub-theme can't find a background image in the images folder of the sub-theme. It works fine in the first instance of the site. Any ideas?

Comments

Doh!

fchandler's picture

After more playing, it works if I put the entire path in the value url(/drupal/themes/CedarCreek/Images/sidemargin.jpg), but not url(../Images/sidemargin.jpg). I am thinking it is because the Drupal install is not in the root. Have I answered my own question?

the path to an image called

sheena_d's picture

the path to an image called within your theme should be relative to the theme root. The site's root should not matter at all.

You may need to clear caches.

Also, you should not have your custom themes in the /themes directory, they should be in sites/all/themes.

thus the confusion

fchandler's picture

That is what I was thinking, and I had cleared caches a number of times to no avail, thus the confusion. Especially after it worked on the initial development platform. The initial Drupal install (after writing the previous comment I remembered) was also not in the main public_HTML, but in a sub-folder (drupal) just like this install. I know the installer was messing with .htaccess and settings.php trying to get it to point to the desired domain name, if that had anything to do with it.

As to the last statement, not meaning to sound disrespectful or impertinent, but why? Shouldn't that be stated somewhere in documentation for sub-themeing? It is not stated in the links attached. In fact the later both state "Upload to your site and enable your new theme on admin/build/themes"

http://drupal.org/node/225125
http://fusiondrupalthemes.com/support/theme-developers/subtheming-quicks...
http://drupal.org/node/629454

the installation of

sheena_d's picture

the installation of contributed modules and theme into sites/all/themes is covered in the Drupal installation documenation: http://drupal.org/documentation/install/modules-themes

Probably need to find what URL is being used.

cgmonroe's picture

Hmm, if one is working and the other isn't, I suspect there is some difference in the URLs being generated and knowing the difference might point to the problem source.

First, the obvious question... you say the relative url to the images directory is ../Images. Is the css file that this statement is in at a directory below your theme root? E.g., it's in the /css directory and the images are in /Images directory? If not, then the relative URL should be ./Images/ and not ../Images.

It could be related to the css optimization performance setting being enabled on the production server. Possibly combined with the non-standard theme location. This will attempt to convert all relative URLs to full URLs. Maybe something here is not working correctly. (Remember to clear cache to refresh any CSS changes if this option is on).

Firebug is your friend here. You "inspect the element" that has the background and use the "computed" tab to see what the full URLs are for css background images. Check that the full URL and the relative URL are the same. Just make sure that you do a full refresh to pull in the new CSS between tests (Control-F5 or Left Shift/Click Reload Button).

Knowing the URLs that your browser is trying to find, you can then try to load the images directly into the browser see if the webserver is finding the image or not. It will also help figure out any .htaccess or other rewrite issues that might be happening here.

Working now

fchandler's picture

I went in and changed the value back to url(../images/sidemargin.jpg), flushed the caches, set the theme to rebuild theme registry, and it works and reads properly in "computed" in Firebug. It is working now. (I have since disabled rebuild theme registry and still working.) I think it had something to do with the installer (not me) trying to get the .htaccess and settings.php to identify the correct domain (possibly at the same time I was trying to correct the lost backgrounds).

As to the "non-standard theme location", this is a Fusion sub-theme. On both the Drupal Fusion page and Fusion's site they both state "Upload to your site and enable your new theme on admin/build/themes". So how is it non-standard, if they are both telling me to put my sub-theme in admin/build/themes? That is still confusing.

cgmonroe's picture

The "non-standard" reference was to the directory you seemed to have installed your theme in. The direct URL you supplied indicated that you put your theme under the core theme directory. (e.g. drupal-root/theme/my-theme)

The "standard" we referred to was that non-core themes should be under the sites directory. Either, sites/all/themes/my-theme (available to all sites) or sites/domain.site.com/themes/my-theme (specific to the subsite).

See: http://drupal.org/getting-started/install-contrib/themes

It will work as you have it set up.. but the reason to move it is so that when you update the Drupal core version, you don't accidentally delete or forget to move the theme. E.g., you start with a new core install, then copy the sites directory over... and your theme isn't there anymore.

The "rules" are basically the same as modules except you use theme instead of module... E.g. you don't put modules in the Drupal core modules directory, you put them under the sites/all/modules directory.

Note: if you move the theme location, I suggest: make a core theme (e.g. Garland) the default; then disable your theme; move it to the new directory; clear cache; and re-enable your theme / reset as default.

Okay i understand

fchandler's picture

That makes good sense. I was only going by the documentation at these two locations. Then the documentation needs to be changed to reflect that at these two locations
http://fusiondrupalthemes.com/support/theme-developers/subtheming-quicks...
http://drupal.org/node/629454
I mean for dummies like me.

It's more of basic Drupal

sheena_d's picture

It's more of basic Drupal knowledge than it is any sort of Fusion-specific instructions, but we happen to be updating our documentation right now, so I'll be sure to submit that as a suggested addition :)

Thank you for you patience and willingness

fchandler's picture

Thank you for you patience and willingness for putting up with me. And I certainly appreciate all the help anyone can offer. I am trying to learn all of this Drupal stuff, from basic to advanced, all at the same time. Probably not a good idea. I think it is called trial by fire, or in over your head. I operate on four maxims in everything I do. Know yourself. Do your best. Don't overdo. (Still have trouble with that one.) Make a little progress everyday. Today I have learned a better practice and the reasons for it.

documentation

fchandler's picture

Now that I understand better how things work, the sentence that I was quoting is correct. If you want to change the documentation it would be the first sentence that would need editing from this:

Copy the fusion_starter folder from Fusion and rename to the name of your choice (eg. “mysite_theme”)

To something like this:

Copy the fusion_starter folder from Fusion to sites/all/themes (create the destination folder if need be) and rename to the name of your choice (eg. “mysite_theme”)

Would that be succinct? Trying to give back where I can.

Well, Fusion should already

sheena_d's picture

Well, Fusion should already be in sites/all/themes when you copy the starterkit. We're doing a complete revision of the documentation right now, so how exactly we end up organizing things will end up affecting how this is included. Thanks for your help, though.

Teach me more it you don't mind

fchandler's picture

So, now I understand, that they only themes in drupal/themes are the core themes. All other themes, Fusion, Zen, anything homespun or otherwise acquired go in sites/all/themes? Just to clarify in case there are others like me who have non-standard installs and find this post.

Except for a few advanced

dpickerel's picture

Except for a few advanced things, pretty much anything you add should go somewhere under /sites. I'll even break them down into 1 more level of subdirectories, 'contrib' and 'custom'. That makes it easy to tell if I've downloaded it from drupal.org or it's something I've created from scratch. That helps for both troubleshooting and updating.

Good to know best practices.

fchandler's picture

Good to know best practices. I think maybe I should go back and re-read my "Using Drupal" book and finally crack open "Pro Drupal Development". I like the idea of contrib and custom, albeit I have not created any custom, yet. I edited my first template file just a week ago (and put it in my-theme folder as guided on Fusion's site). It does make me wonder what all else I might be doing non-standard, or worse wrong.

standard procedure

fchandler's picture

I have also been looking at standard procedure for urls. Is lowercase the rule?

triDUG

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: