Hey folks, I'm fairly new here (this is my first post). When I have Drupal installed on a MySQL database, and I add content to my Drupal site, is EVERYTHING I add automatically stored in the MySQL database? The reason I ask is because I'm exporting my local database to a real host, and I was wondering if there are some things that I need to upload separately. Essentially, is everything stored within the Drupal folder (which is installed on the database) automatically saved in the database so that when I dump the database to a .sql file and upload to a live host, I don't need to upload content separately? This would include content that I've added using Drupal (pages, blogs, etc.), as well as other content that I've placed in the Drupal folder on my computer (e.g. pictures, themes, modules).

Thanks in advance for any help!

Quick explanation: I was watching the tutorial videos on learnbythedrop.com (which are very helpful), but the one that talked about all this was only a preview. The reason I didn't purchase the full video is because I'm working on a project with professors at my university, and I thought I might be getting myself into a sticky situation if I paid for the videos myself rather than requesting the University to appropriate funds to purchase the content, and I certainly don't have time to do the latter.

Comments

marcvangend’s picture

Hi, welcome to the Drupal community.

Not everything is stored in the database. A Drupal installation is a combination of files and database.
The database stores:
- all content except attached files
- users
- menu's
- cache
- configuration (except the basics in settings.php)
- string translations
- and practically everything else you can change in the back-end
The file system stores:
- Drupal core files
- additional modules
- your theme
- files attached to content (images, pdf downloads)
- some basic settings in settings.php

You can develop your site on a test server and then move both the files and the database to your live server when it's ready. Detailed instructions how to do that can be found elsewhere on Drupal.org (I don't know the url, sorry).

raindrop’s picture

I took the plunge and decided to integrate the CMS with an existing site but admittedly that is harder to do but possible it is.

I'm using the minimalist theme, so does that mean I can delete all the others?

marcvangend’s picture

You can delete all other themes, yes. Make sure you don't delete /themes/engines. It is also recommended to keep at least one standard theme (Garland for instance) for debugging purposes. BTW. Place your own theme in /sites/all/themes, not in /themes.

raindrop’s picture

Thanks for responding with that information.

If I remove those themes bar garland say and chameleon, is it possible then to drop Chameleon into sites/all/themes and would I still see the option(s) to install any and all previously available themes?

I've been modifying chameleon.theme and some of the includes etc., and it seems fairly easy to do, albeit time consuming but it's fine since it's not IMV a production site as the saying goes.

I want to be careful since I don't want to have to backtrack if I've coded something incorrectly but I am in the very least impressed with the coding frameworks used by default.

Regards

marcvangend’s picture

All themes present in /themes and /sites/all/themes will be available to enable; deleted themes will immediately disappear from the /admin/build/themes page.

Should I start on a custom theme based on an existing one, I would first copy it to sites/all/themes and rename it (and rename functions in template.php accordingly!) before altering anything. You should be able to move your chameleon theme from on folder to the other (see http://drupal.org/node/273455#comment-891505) and I really urge you to do that: If you leave it in /themes, you might accidentally overwrite all your changes when you apply a security update (like Drupal 6.15, when it is released).

When you say you've altered includes, which includes do you mean? Changing core files is never recommended and usually not needed (if you know the tricks like theme overrides and drupal hooks).

raindrop’s picture

Thanks again.

I removed two profiles and am now left with Garland (thanks for the hint there) and cameleon. Marvin seems to be part of the latter theme.

I have edited the theme file but I have winmerge so can verify what I am doing even for the includes. I know it's not recommended but if there is enough information come update time, I'm sure it won't be a big issue and it's kind of interesting anyway learning where all the functions are.

What I am surprised about most is how drupal likes to escape " in attributes such as class, when this isn't really necessary from a programming point of view as the only real time (dare I say) anyone would need to do that is when you need to escape inverted commas throughout plain text.

One day I hope drupal will be rewritten to encompass this particular situation as it would be more compatible with other languages.

Regarding themes, from that other thread I gather you simply copy a particular theme folder eg., chameleon into the sites/all folder and rename it, is this right and it will appear as a theme I can use say for example the Administrator theme, or could it work the other way round where either garland or the original chameleon theme can be chosen for the administrator only?

Greetings to all.

marcvangend’s picture

I'm going to repeat myself only once (I will not mention it again after this post): Do not change the include files. In other words: Don't hack core. If you want to learn where all the functions are, browse http://api.drupal.org. IMHO, you will only experience the power of the Drupal framework once you learn about theme overrides (for themers, to change html output and visual appearance) and/or drupal hooks (for module developers, to add functionality or change behavior).

Can you give an example for the things you're saying about escaping quotes? I'm curious where and how often this happens.

You are right, you can add themes by placing a theme in /sites/all/themes. All available themes can be selected as default theme or admin theme. You can also enable multiple themes and allow all users (or selected roles) to choose their own theme.

raindrop’s picture

Thanks for the advice.

This is an experiment I am working on so no damage (except maybe to reputations) is envisioned but like many things in the computing world, they come from a certain heritage and legacies remain long after original ideas are implemented.

The best thing drupal has got going for it is that it renders xhtml and uses css, as well as giving people a choice as to tabled or presentational only layouts.

Single quotes should (be able to) be used in rendered html attributes instead of double quotes but the way the framework is currently written you need to go and edit it yourself when already the w3c is using single (and not double) quotes for xml.

This I feel is the next step for drupal.

New versions of PHP require it anyway, so whichever way you look at it the code is better off changing since it makes no difference to drupal itself other than how the code is parsed. Naturally if it was written in a more consistent way then you'd have an easier time reading back html from websites.

Personally I never liked CMS until now so the fact that I've even bothered to take it on at all says something. I am no W3C 'purist' as the saying goes but PHP is quite old now and even PERL does a better job of handling context (not that PHP needs to do more) but it's too complicated a language for general use.

For anyone who is interested here is an example..

.. when you have css embedded in javascript functions you need to differentiate the quotes used, and obviously (at least to me) it's best to use single quotes for the javascript function and double quotes for css values.

I will try and provide a more solid example in due course but the first problem I encountered was the fact that there is no XML declaration and while editing I found that meta tags were being sent twice. Although I cleaned up the function responsible doesn't this say something when in comments you have mentioned an attack vector.

A bit of tweaking never hurt anyone and could in fact optimize the platform but if no one agrees well.

Many regards

marcvangend’s picture

Personally, I'm not an expert on the exact w3c specifications, but I couldn't find any document which says that single quotes are preferred over double quotes. I'd love to read them.
What you're saying is not offending at all, in my experience Drupal developers are very open for discussions about standards and good code. Maintenance of code is a joint effort of many developers who meet in the #drupal irc channel and work on issues in the issue queue (http://drupal.org/project/issues/drupal). At this moment, new features are not added to Drupal 7 anymore and all API's are frozen. The focus is now on bug fixing, performance, usability and documentation. Please feel free to join #drupal or create an issue in the issue queue: http://drupal.org/node/add/project-issue/drupal.

raindrop’s picture

I appreciate the response.

One thing I've always liked about drupal is not being able to quote someone, as well views aren't mentioned and it may be an odd topic to mention all this in bearing in mind the irc channel however, what I was trying to say is you *need* to have differentiating quotes for some functions.

PHP of course like all server side and CGI based languages has as its' default method the escape \" function and it's what you are taught but when I started reading about the w3c DOM I started to realize there were many contexts going on, especially when incorporating many languages.

Don't get me wrong drupal does a top job and what it does, and I've examined many CMS's over the years only to be dismayed at the lack of standards' support so skipped over them completely but now I'm probably more excited about it then I've ever been just thinking about how the technology might be employed to write standalone XHTML (and xml) pages, in other words full web based content generation facilities from things like word documents to spreadsheets and similar formats, remembering of course that things like XML can be used as flat file databases for all kinds of binary content and you start to realize the absolute potential of a standards compliant content generation machine.

Anyway, I'm happy with what it's doing right now and I don't think anyone really chooses to "hack core" unless they either want to need to learn at someone elses' expense or have a specific reason that they probably keep to themselves. I am in the middle but am looking to see if there is any support for modifying the underlying codebase.

Thanks again for writing.

marcvangend’s picture

@cwpatterson1: I realize that this thread has drifted away from your original question. Still, I hope you got the answer you were looking for.