Jump to content
xisto Community
doudou

How To Test Drupal Themes?

Recommended Posts

The first one is, set up a local server on your PC (may be using XAMPP or EasyPHP), and then setup Drupal there. (Just FTP download your site, and put it in the www folder of the Apache). Then, I think it is straight forward. Put the theme you created in the themes folder, start your (local) Drupal, and select it and see how it turns out.I have heard people use different themes for different roles, but I am not sure how this can be achived and it is too much intrusive. This method, requires a lot of code change, I suppose.So, the best way is to have a local copy of your Drupal website running on your workstation, fiddle around with it, and when you are satisfied, upload it.

Share this post


Link to post
Share on other sites
I don’t suppose there is any other way of validating my code? I don’t have a server set up on my computer and it’s really too much trouble. I’m afraid to try it on my site because if it doesn’t work, it hard to get it back to my original theme.

Share this post


Link to post
Share on other sites

Well, you can easily create a new Drupal installation inside a new folder of your site's web server. If you really want you can actually get multiple instances of Drupal to run from the same codebase, but that's overkill for an action such as testing out your theme.
Running it on your main site isn't as bad either if you don't have any visitors, because it's actually very easy to change back to the old theme (just disable your new theme and set the default to the old theme).
But anyways, I think the best long-term approach would be to just easily set up a complete webserver using XAMPP.

Share this post


Link to post
Share on other sites

But anyways, I think the best long-term approach would be to just easily set up a complete webserver using XAMPP.

Should I download the lite version or the full version? The Lite version doesn't seem to have a installer.

Share this post


Link to post
Share on other sites

Yes, setting up a server at home can be difficult, but as I said earlier, and also as seec77 pointed out, the job has been done easy by XAMPP.XAMPP stands for Apache, MySQL, PHP and PERL. (Do not ask me what 'X' stands for, 'cause I do not know :unsure:).Anyway, do not bother with the lite version. Down load the full version. I downloaded the self extractor, and extracted it to C:\xampp folder. After all the files have been extracted, run the C:\xampp\setup-xampp.bat batch script. (That is, just browse to the folder you have installed xampp and run the file setup-xampp.bat). By doing this all paths in the configuration will be updated.That is it, it is as simple as that.Start the different servers using the GUI "xampp-control.exe" that is present in the same folder. A prudent move would be to make a short cut of this and place it on your desktop. Just click on the Apache and MySQL Start buttons if they are not running already.Now, go ahead and install a Drupal site on the \xampp\htdocs folder. If you had earlier used the Fantastico installer to install Drupal, you would find doing this a bit more difficult, but reading through the Drupal installation instructions is easy.Anyway, first install the XAMPP and then try to install Drupal. If you have any problems, let us know and one of us would walk you through.

Share this post


Link to post
Share on other sites

I have successfully installed XAMPP I have ran into some problem installing drupal.

 

I have followed the instruction listed in several sites, since the handbook always confuses me. I must have incorrectly configured the “settings.php” file because I can’t seem to connect.

 

First I tried to connect without any password, just the username ‘root’. But it doesn’t seem to work.

 

Then I opened up the database ‘mysql’ with phpMyAdmin and added the password for user “root”.

 

I also added the my password in cofig file under phpMyAdmin.

 

So now, I cannot access both phpMyAdmin and drupal.

 

What did I do wrong?

 

Thanks

Edited by doudou (see edit history)

Share this post


Link to post
Share on other sites

Ok doudou.

 

Let us do this one by one.

Unzip the drupal tarball to the htdocs directory

Now we need to create a Drupal database with proper username and password (because, this we, would be using in settings.php):

Open a MSDOS command window. (Choose Start->Run... and then type 'cmd' and hit OK.

type 'CD c:\xampp\mysql\bin' (note to replace c:\xampp to whereever you have installed xampp)

type 'mysqladmin -u root -p create durpaldb'. It may ask for password. If you had changed the password earlier for root, give it now.

type 'mysql -u root -p'. Again, give the root password.

copy and past the following QL command:

 

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,

ALTER, CREATE TEMPORARY TABLES, LOCK TABLES

ON drupaldb.*

TO 'username'@'localhost' IDENTIFIED BY 'password';

 

Note: repalce username and password with anything you wish for your 'drupaldb' database. Just remember them.

 

Once you hit enter, it should give: 'Query OK, 0 rows affected'

After that, give a ' FLUSH PRIVILEGES;'

Enter 'exit' and come out of the prompt

Then enter:

 

mysql -u username -p drupaldb < database/database.4.1.mysql

 

Use the username you had used earlier while granting permissions. You will need to give that same password.

Also, it is advisable to use the full path of databasee.4.1.mysql file.


Now, go to the sites/default/settings.php file, and locate the $db_url. Remove the standard string there and replace it with:

$db_url = "mysql://username:password@localhost/drupaldb";

 

Again replace username and password with whatever you had given earlier.

With in the Drupal directory, create a folder called 'files'

That should work. If it doesnot, just tell us on which particular step you are failing.

Share this post


Link to post
Share on other sites

Yes doudou, I think that would be prudent. I gave the full set of installation instructions because I could not actually pin point on what the problem was from what you have given. Just try to do things from the scratch, and then hopefully it works.If it does not, try to give the exact step where you failed to get the result as you expected. That would put us both on the same page and then we can work on the problem and try and get a solution for that.

Share this post


Link to post
Share on other sites
I uninstalled and reinstalled XAMPP as you suggested. Unfortunately it did not solve my password problem. I still have the password setup f or MySQL, and although I know what it is, I cannot access it. Anyother suggestions?

Share this post


Link to post
Share on other sites

That's weird. I personally don't have any experience with XAMPP, so I don't know what's up with that. Have you tried logging in from phpMyAdmin? If you can login from there, use the username and password and put them in Drupal (in the $db_url variable) and it should work. The questions is, have you been able to log in into phpMyAdmin with the password you supposedly know?

Share this post


Link to post
Share on other sites
I finally got it working. Apparently the passwords did reset after I rebooted my computer. You instruction were pretty good. Thanks a bunch. Now that I have my local server running, I can start writing and testing my own Drupal themes. Do you have any suggestions on related websites and resources?

Share this post


Link to post
Share on other sites

Nice to know that you finally got it working.I do not know of anyother site that would help other than Drupal.org itself. They have links to many other related sites. Just go there and snoop around, and I think you could find something useful.For my Drupal driven site, I downloaded a simple theme and with help of seec77, I modified it to what I required.

Edited by Vyoma (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.