Getting started with Drupal for GCI Students
Introduction to Drupal: This lesson discusses about Drupal, how its community works and reasons to use and contribute to Drupal.
Here is a new fact that I learned about Drupal in this lesson:
Dries Buytaert began the Drupal software as a message board in 1999, and in 2001 drupal.org was created.
Beginning back in 1999, Drupal has gained a big community support since then. Drupal powers millions of websites and has 1,050,000+ users and developers today.
There was some information about the functioning of Drupal community. People can chat with the community on IRC, forums and events. It was a good read with informative things about Drupal.
Getting Familiar with Drupal Code: Drupal Core contains some of the basic features of Drupal which can be further extended by using modules and themes. This was again a good read.
How GCI works?: This seemed like an outdated text. Although, since I was a GCI participant last year too, I completely understand how GCI works.
Registering and Joining drupal.org:
I have been active on drupal.org since more than a year. My profile is: https://www.drupal.org/u/ragasirtahk .
I have been using Git since two years! Still, I took some screenshots of the steps. I am using Windows, so the steps I followed were:
- Download the latest version of Git for your operating system by going to http://git-scm.com/downloads.
- Run the installer. For Windows, you can accept the defaults as they are all reasonable. On the “Adjusting your PATH environment” screen choose “Run Git from the Windows command prompt”).
- To confirm Git has installed correctly, open a terminal window and at the prompt, type ‘git’ (without the quotes). A list of the most common Git commands will print to the screen. You can also type ‘git — version’, this will display the installed git version.
Moving Around in the Command Line: The there are some basic commands to know,
ls is used to display the contents of the directory,
pwd tells the current directory,
cd is used to change directory. Pressing
ctrl + c cancels an action.
- Tell your name to Git, the name will be used in places like commits made by you. Use
git config --global user.name “Your Name”for this.
- Provide your email to Git, this too will be associated with your commits, etc. Use
git config --global user.email firstname.lastname@example.org this.
- Set Git to use automatic line endings:
git config --global core.autocrlf true.
Using Git for Drupal
Cloning Drupal Repository
git clone http://git.drupal.org/project/drupal.git to clone the Drupal repository. This will download the Drupal code repository.
git checkout branchname is used to change branches in a cloned repository.
git pull is used to download the latest changes from Drupal.org.
Downloading a Project
Navigate to a project page on Drupal and click on the version control tab on the page. Select the version of the project which matches your Drupal version. Copy the commands and execute them in the
/modules directory of your Drupal installation.
There are some informational commands which are used frequently:
Installing Drush on Windows:
I have been using Drush before doing this task! The steps for this are:
- Install Composer, verify installation.
- Install Drush
composer global require drush/drush:8.*, verify installation.
- Run the
drush core-statuscommand in your Drupal website directory.
Install Drupal locally:
In this ladder, I found that at many places Drupal 7 was written but Drupal 8 is the latest version and the last peer review was on 23 Sep 2013. So, I concluded that the steps are outdated and decided to use the official Acquia guide for the steps required to install Acquia Dev Desktop and Drupal 8.
I uninstalled Bitnami Drupal Stack before proceeding with the installation in order to prevent any Apache local server port issues or any MySQL issues.
After installation of Acquia Dev Desktop, I chose the option to “Start from scratch…..site”. This downloaded Drupal 8 and created an environment for it to run properly. After that, I opened the local site link in my web browser and completed the installation of Drupal 8.
Here are some screenshots that I took during the installation of Acquia Dev Desktop and Drupal 8:
Get comfortable with Drupal:
I have been using Drupal since a long time and I was familiar with all the steps given below except a few.
Here again, some guides were outdated and talked about Drupal 7 instead of Drupal 8. So, I decided to find similar guides for Drupal 8.
- For the “configuring basic site settings” steps, I used this guide.
- For the “add content” step, I recommend this guide.
- For the “add taxonomy” step, I used this guide and this guide.
- The next three steps are almost the same in Drupal 8.
- The last step i.e. “enable a different theme”, I found this guide and this guide. I installed this theme on my Drupal installation.
Here are a few screenshots that I took during these steps:
After completing all the steps, I decided to get back to my favourite Bitnami Drupal Stack so I uninstalled Dev Desktop and got back to a fresh install of Bitnami Drupal Stack.
Getting started in the issue queue:
I followed the guide and created this issue: https://www.drupal.org/project/1388780/issues/3016863 .
I had completed these steps earlier during completion of some other GCI task. Just reposting them here…
Before you begin, you can optionally run a few Git configuration commands to make Git more legible. The commands are:
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global color.diff auto
- Using the command line, move into the Drupal 8 sandbox you have cloned if you are not already there.
- Check which branch you are on with
- If there’s not an asterisk next to 8.x, you need to check out 8.x with
git checkout 8.x
- Review the example issue on Drupal.org and find this problem in your locally installed sandbox site.
- Download the patch in comment 2, which is the latest patch.
- In your sandbox site, go to the page where the changes will take effect by going to Content > + Add content > Article (node/add/article), and then scrolling down and clicking the URL path settings tab. The help text for that setting is what will be changing with the patch.
- Apply the patch by using the command
git apply 1326088-rewrite-desription-for-url-alias.patch
- Refresh the page in your local sandbox site you have open in your browser (the node/add/* page) and confirm the issue has been resolved by seeing the help text change.
- Once done testing, undo the changes applied by the patch with
git reset --hard
Although most of the things in this ladder were known to me, I did learn some new things as well. Taxonomy was something that I had never heard of, now, I completing understand its usage and importance. The last two reads in the ladder were really informative, I have even bookmarked them in my browser for future needs!
All in all, it was a good DrupalLadder, but, it requires some updates as at many places it discusses about Drupal 7 instead of Drupal 8.