Built with Drupal 8: A Front-Ender's Tale of Danger and Suspense

Error message

  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home1/markspap/public_html/kathy/includes/menu.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/markspap/public_html/kathy/includes/common.inc).
May 3, 2015

UPDATE: In August 2015 I moved this site back to Drupal 7. Drupal 8 is still in beta, and though it's going to be fun, it's obviously not ready for prime time yet.

A few weeks ago I decided to rebuild this blog from scratch.  It had been literally years since I'd posted, so I figured I'd include just a few of the last entries.  Also, Drupal 8 was in beta and I'm impatient.  Why not build a brand new site in 8.0.0-beta9?, I thought.   How hard could it be?

So, okay.  It was a little bit hard.  But surprisingly, the experience wasn’t as hairy as you might expect.  Here’s a summary of my adventurous, experimental walk on the wild beta side. 

Installing Drupal 8

Before I go further, I should mention that I installed Drupal 8 on a previously set up local environment.  (If you don’t know what that means, you can find out more here.   For fellow Mac users, I’d recommend these instructions.)

Honestly, installation was a breeze.  The whole process took less than 5 minutes and was similar enough to Drupal 7 that I felt on solid ground.  I just downloaded and untarred core, added a new database in Mamp, went to the site in my browser and followed the instructions.  Easy peasy.

Playing with core was equally as uneventful and fun.  I added a new user, enabled and disabled core modules, added a new content type and a taxonomy vocabulary, tweaked permissions, etc.  All without a hitch.  The admin interface looks and acts almost the same as D7's. For someone who builds a lot of sites for non-technical admins, this is a big relief.

I decided this was easy.  Drupal 8 was a lot more stable than I’d expected.  I was feeling confident, so I decided to try creating a custom theme.

Custom Theming: Take One

Considering D8’s not even released yet, the documentation on drupal.org on Theming Drupal 8 is pretty extensive.  In fact it’s so extensive, it’s a bit overwhelming at first. 

If you're familiar with D7 theming and just wanted to get up and running quickly, you might prefer 27 Questions (and Answers) from My First Drupal 8 Site Build by Matt Korostoff.  His article was extremely helpful, although I was glad to be have the d.o documentation to refer to when I got stuck or wanted to delve into something more deeply.

Adding JS, CSS and Font Files and Libraries

I decided to keep a hand on the tow line and created a Classy subtheme, following Matt’s instructions for setting up the x.info.yml and and x.libraries.yml files.

You can see the .info.yml file looks a lot like the .info in Drupal 7.  The main difference is the way CSS and JS are added.  Instead of adding them directly to the .info.yml file, you include a reference to a .libaries.yml file, and that is where you add your scripts, stylesheets and dependencies. That was probably the biggest gotcha for me--figuring out how to include JS scripts, libraries and dependencies and font libraries.  There was conflicting information on the webs, but this is what worked for me:

Because I had a number of CSS and JS files, I followed the advice (from d.o. maybe?) to break them into two groups—global-styling and global-scripts,. These will now be available to every page.

My scripts.js is actually just a teeny few lines to handle the navigation bar, but surprisingly, Drupal 8 doesn’t load JQuery on every page automatically like D7 did. You have to add it as a dependency, as well as any other js you want to run on every page.

One thing I never figured out was how to add my custom fonts. I use Google's PT Serif and Inconsolata in this theme, and the only way I could get the fonts to load was by adding an @import to my main CSS file:

@import url(http://fonts.googleapis.com/css?family=Inconsolata|PT+Serif:400,400italic,700,700italic);

It works, and that'll have to do for now.

Twig Templates

I find Twig to be easier and more intuitive than the PHP of previous .tpl.php files. If you don't agree, some of the documentation on d.o might be helpful, especially Twig Coding Standards.

The Classy theme was a godsend for me when it came to creating custom templates. Whether you create a subtheme of Classy or not, you can look at the slew of templates it includes to get an idea of how to create your own.

For this theme, I needed a custom block--search-form-block.html.twig and changes to page.html.twig and node.html.twig. For instance, like Matt Korostoff, I don't much like the default "submitted by" line. To tweak it, I copied the node.html.twig from Classy, plopped it in my theme's template folder, and changed the line:

I still haven't figured out how to get my custom date/time format to print, but I'll keep working on it. :)

Custom Modules and More

I enabled a few contrib modules (Prepopulate, Youtube Field, Captcha and Recaptcha) that were absolutely required before going live. All worked beautifully out-of-the-box. However, the other contrib modules I tried gave me either a WSOD or that ghastly pink error message.  

At this time I'd recommend enabling contrib modules cautiously, if at all.  Most are still in dev for a reason.  Maybe try them on a test install first and see what blows up.

Luckily this is a simple site that can run without many contrib modules. If you have a complex site that requires a number of them, you may have to wait a bit before they're all ported to 8. Bluespark publishes a helpful live list of the current status of the top 100 Drupal modules. Check it out to see if your modules are listed.

I'm know you're waiting on tenterhooks for your favorite modules, but remember that most of the people who create and maintain contrib modules do so on their own time and without pay.  That's pretty darn generous of them, and I'm grateful for all the vacation time and off hours they spend creating modules that make my life easier. Unless I'm able to jump in alongside and start slinging code, I'm happy to wait patiently for contrib modules to be ported.

(Note to self: Patience you must have, my young padawan.)

Conclusion

The (sort of) bad news: Not everyone is crazy enough to spend two days and nights building a D8 site. It still isn't easy. You may get discouraged.  You will lose sleep. I still can't get drush 7 (required for D8) to rebuild caches. Importing and exporting a database between dev and live without at least a few WSODs is nigh on impossible. I encountered a number of alien requirements and strange error messages that took time to track down and debug.

The good news: Smarter people than me are working on those problems. Yay!

More good news: I'm no longer afraid of WSODs or error screens that fill three screens. Also, I busted my local dev site and had to rebuild it so many times, I now know a great deal about installing, enabling and configuring Drupal 8.

Was it worth it? You betcha! I'm no programmer, so I was nervous about Drupal 8 coming down the pike. I'm not nervous anymore. In fact, I'm looking forward eagerly to a release candidate.

Thanks to all the people who put so much time and effort into Drupal 8. It's really spectacular, and we thank you for generously sharing your code with us.

Comments

Providing a real natural hair care and skin care range that is affordable to the family, has always been my passion and dream.” Said Edwina Pearce owner and creator of <a href="https://naturesquest.com.au/">Nature's Quest</a>. In 2009 Edwina was a stay at home mum to 4 beautiful girls and 3 handsome boys, YES that’s right 7 kids!

I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man!

This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!

Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
Remember the more computers you use, the higher your chances of getting the treasure!

DOWNLOAD FOR FREE

Telegram:
https://t.me/btc_profit_search

It's going to be ending of mine day, except before end I am reading this great piece of writing to improve my knowledge.

Thank you, I have recently been looking for information about this subject for a long time and yours is the best I've found out till now. But, what concerning the bottom line? Are you positive concerning the source?

This blog was... how do I say it? Relevant!! Finally I've found something that helped me. Many thanks!

Peculiar article, totally what I wanted to find.

Hi! I know this is kinda off topic however I'd figured I'd ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa? My website goes over a lot of the same subjects as yours and I believe we could greatly benefit from each other. If you are interested feel free to send me an email. I look forward to hearing from you! Excellent blog by the way!

Hola! I've been reading your blog for a while now and finally got the bravery to go ahead and give you a shout out from Huffman Tx! Just wanted to mention keep up the excellent job!

Thanks to my father who informed me regarding this weblog, this web site is genuinely amazing.

It's in fact very difficult in this active life to listen news on TV, thus I simply use world wide web for that purpose, and get the newest information.

You should take part in a contest for one of the most useful blogs on the internet. I am going to highly recommend this web site!

I'm curious to find out what blog system you have been working with? I'm experiencing some minor security problems with my latest site and I'd like to find something more safeguarded. Do you have any suggestions?

I think what you posted made a bunch of sense. However, what about this? suppose you added a little content? I mean, I don't wish to tell you how to run your website, however suppose you added something that grabbed a person's attention? I mean %BLOG_TITLE% is a little vanilla. You could look at Yahoo's front page and note how they create article headlines to grab people interested. You might add a video or a related pic or two to get readers excited about what you've written. Just my opinion, it would make your posts a little livelier.

Hey! I know this is kinda off topic however I'd figured I'd ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa? My website addresses a lot of the same subjects as yours and I believe we could greatly benefit from each other. If you happen to be interested feel free to shoot me an email. I look forward to hearing from you! Great blog by the way!

I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man!

This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!

Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
Remember the more computers you use, the higher your chances of getting the treasure!

DOWNLOAD FOR FREE

Telegram:
https://t.me/btc_profit_search

What's up friends, its great piece of writing concerning tutoringand fully defined, keep it up all the time.

I enjoy what you guys tend to be up too. This sort of clever work and coverage! Keep up the awesome works guys I've added you guys to our blogroll.

With havin so much content do you ever run into any issues of plagorism or copyright violation? My website has a lot of completely unique content I've either authored myself or outsourced but it looks like a lot of it is popping it up all over the web without my permission. Do you know any methods to help reduce content from being stolen? I'd truly appreciate it.

I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man!

This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!

Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
Remember the more computers you use, the higher your chances of getting the treasure!

DOWNLOAD FOR FREE

Telegram:
https://t.me/btc_profit_search

I'm extremely impressed together with your writing talents and also with the structure for your blog. Is that this a paid subject matter or did you customize it yourself? Either way keep up the nice quality writing, it's uncommon to look a nice weblog like this one today..

Hello! Do you use Twitter? I'd like to follow you if that would be ok. I'm definitely enjoying your blog and look forward to new updates.

I have read several good stuff here. Certainly worth bookmarking for revisiting. I surprise how so much effort you place to create such a great informative web site.

Hello there, I discovered your site by the use of Google at the same time as looking for a related topic, your web site came up, it seems to be good. I've bookmarked it in my google bookmarks.
Hi there, simply changed into aware of your blog thru Google, and found that it is really informative. I am gonna watch out for brussels. I'll be grateful if you happen to continue this in future. Lots of people will be benefited out of your writing. Cheers!

What's up, its fastidious paragraph on the topic of media print, we all be familiar with media is a enormous source of data.

Greetings from Colorado! I'm bored to death at work so I decided to check out your site on my iphone during lunch break. I love the info you present here and can't wait to take a look when I get home. I'm shocked at how quick your blog loaded on my phone .. I'm not even using WIFI, just 3G .. Anyhow, awesome site!

Simply want to say your article is as surprising. The clearness for your put up is simply excellent and i could assume you are knowledgeable on this subject. Well with your permission let me to take hold of your RSS feed to stay up to date with imminent post. Thanks one million and please carry on the enjoyable work.

Pretty section of content. I simply stumbled upon your web site and in accession capital to assert that I acquire in fact loved account your blog posts. Anyway I'll be subscribing for your augment or even I achievement you get entry to persistently fast.

Its such as you learn my thoughts! You seem to grasp so much approximately this, like you wrote the book in it or something. I believe that you can do with some percent to force the message house a little bit, but other than that, that is wonderful blog. An excellent read. I'll definitely be back.

Your method of describing the whole thing in this paragraph is really fastidious, every one can easily understand it, Thanks a lot.

obviously like your website but you need to test the spelling on quite a few of your posts. Several of them are rife with spelling problems and I in finding it very bothersome to inform the truth however I will surely come again again.

Tremendous issues here. I am very glad to peer your post. Thanks so much and I am looking ahead to contact you. Will you kindly drop me a mail?

We're a group of volunteers and opening a new scheme in our community. Your site provided us with valuable info to work on. You have done a formidable job and our entire community will be grateful to you.

I think this is one of the most significant information for me. And i am happy reading your article. But want to remark on few common issues, The site taste is wonderful, the articles is in point of fact great : D. Good job, cheers

Heya superb website! Does running a blog such as this take a great deal of work? I have absolutely no expertise in computer programming but I was hoping to start my own blog in the near future. Anyways, should you have any recommendations or techniques for new blog owners please share. I understand this is off topic but I simply needed to ask. Many thanks!

This article gives clear idea in support of the new visitors of blogging, that in fact how to do blogging.

I am extremely inspired together with your writing abilities and also with the structure for your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it's uncommon to peer a nice weblog like this one nowadays..

I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man!

This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!

Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
Remember the more computers you use, the higher your chances of getting the treasure!

DOWNLOAD FOR FREE

Telegram:
https://t.me/btc_profit_search

We are a group of volunteers and opening a brand new scheme in our community. Your website offered us with valuable information to work on. You have done an impressive activity and our whole neighborhood will probably be thankful to you.

Helpful information. Lucky me I found your web site by chance, and I'm stunned why this coincidence didn't took place in advance! I bookmarked it.

A low-fat, plant-based totally weight loss program helps mitigate the dietary reasons of diabetes by addressing 3 most important elements: lowering fats that interferes with hormones, alkalizing and reducing infection in the device, and offering an abundance of micronutrients. It helps insulin bind greater effectively to cellular receptors, commencing pathways for glucose to go into the cell, thereby reducing blood sugar tiers. Cellucare Starting the day with a nutrient-wealthy, alkalizing green smoothie, as an example, can assist reduce in a single day acidity buildup and provide a wholesome, low-fats, and nutritious start to your day. This smoothie, filled with spinach, cucumbers, ginger, lemon, and chia seeds, is a testament to the strength of a plant-primarily based weight loss program in handling diabetes.Other plant-based breakfast alternatives should encompass a bowl of oatmeal crowned with fresh fruits and nuts, whole grain toast with avocado, or a tofu scramble with an expansion of vegetables. https://niagaraopendata.ca/user/cellucare-reviews

My spouse and I stumbled over here by a different web address and thought I might check things out. I like what I see so now i'm following you. Look forward to looking into your web page repeatedly.

Pages

Add new comment