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

Hmm it looks like your website ate my first comment (it was extremely long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog. I too am an aspiring blog writer but I'm still new to the whole thing. Do you have any helpful hints for beginner blog writers? I'd really appreciate it.

Thanks for sharing your thoughts about %meta_keyword%. Regards

Your style is unique in comparison to other folks I have read stuff from. Many thanks for posting when you have the opportunity, Guess I will just book mark this blog.

Hello, just wanted to mention, I enjoyed this post. It was funny. Keep on posting!

This post will assist the internet people for setting up new webpage or even a weblog from start to end.

Way cool! Some extremely valid points! I appreciate you penning this article and the rest of the website is also very good.

Nice blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

It's hard to come by well-informed people about this topic, however, you seem like you know what you're talking about! Thanks

Now I am going to do my breakfast, afterward having my breakfast coming again to read further news.

Just desire to say your article is as astounding. The clearness in your post is just cool and i can assume you are an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.

Hi there, the whole thing is going fine here and ofcourse every one is sharing data, that's actually good, keep up writing.

Thanks , I've just been looking for information about this subject for ages and yours is the best I've found out so far. However, what about the bottom line? Are you positive about the source?

It's remarkable designed for me to have a web page, which is useful for my know-how. thanks admin

Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a bit, but instead of that, this is great blog. A fantastic read. I'll definitely be back.

This paragraph will assist the internet viewers for setting up new web site or even a weblog from start to end.

Howdy! Do you use Twitter? I'd like to follow you if that would be okay. I'm undoubtedly enjoying your blog and look forward to new posts.

Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the website is also really good.

Le code promo 1xBet : MAXBOX doit être utilisé lors de votre inscription pour profiter d'un bonus de +100% jusqu'à 130 $. Utilisez notre code promo 1xbet pour obtenir un bonus de 200% sur votre premier dépôt de paris sportifs et l'offre maximale de casino. Bonus de bienvenue avec le code 1xbet sur le casino en ligne : jusqu'à 1 500 $ et 150 tours gratuits. Quel est le code promo 1xBet ? C'est une combinaison de chiffres et/ou de lettres qui, lorsqu'elle est utilisée, vous donne droit à certains avantages ou bonus.

Article writing is also a excitement, if you be familiar with afterward you can write or else it is difficult to write.

I don't know whether it's just me or if perhaps everybody else experiencing problems with your blog. It seems like some of the text within your content are running off the screen. Can someone else please comment and let me know if this is happening to them too? This may be a issue with my internet browser because I've had this happen previously. Thanks

I for all time emailed this webpage post page to all my associates, since if like to read it next my links will too.

Hi there, just became aware of your blog through Google, and found that it is truly informative. I am going to watch out for brussels. I will appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!

I was recommended this blog by my cousin. I'm not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks!

I'm not sure why but this site is loading extremely slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later and see if the problem still exists.

What a data of un-ambiguity and preserveness of valuable knowledge regarding unpredicted emotions.

You can definitely see your expertise in the article you write. The arena hopes for more passionate writers such as you who are not afraid to mention how they believe. Always go after your heart.

I visited multiple web pages however the audio quality for audio songs existing at this web page is truly superb.

Excellent article. I definitely appreciate this site. Continue the good work!

Everyone loves it when people come together and share views. Great blog, stick with it!

I am now not certain where you're getting your information, but great topic. I needs to spend some time studying much more or understanding more. Thanks for wonderful info I was searching for this info for my mission.

Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyhow, just wanted to say fantastic blog!

Unquestionably believe that that you stated. Your favorite reason seemed to be at the net the easiest factor to have in mind of. I say to you, I definitely get irked at the same time as other folks consider issues that they plainly don't know about. You controlled to hit the nail upon the highest and defined out the entire thing without having side effect , people can take a signal. Will probably be again to get more. Thanks

hey there and thank you for your information – I've definitely picked up anything new from right here. I did however expertise a few technical issues using this web site, since I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your web host is OK? Not that I'm complaining, but slow loading instances times will sometimes affect your placement in google and can damage your quality score if advertising and marketing with Adwords. Anyway I'm adding this RSS to my e-mail and can look out for much more of your respective intriguing content. Make sure you update this again soon.

Thank you for every other fantastic post. Where else could anybody get that kind of information in such a perfect method of writing? I have a presentation subsequent week, and I am at the look for such information.

Excellent post. I was checking constantly this blog and I am impressed! Extremely helpful info specifically the last part :) I care for such info a lot. I was seeking this certain info for a long time. Thank you and best of luck.

Greetings from Idaho! I'm bored at work so I decided to check out your site on my iphone during lunch break. I really like the info you present here and can't wait to take a look when I get home. I'm amazed at how fast your blog loaded on my mobile .. I'm not even using WIFI, just 3G .. Anyhow, amazing blog!

For newest news you have to go to see internet and on internet I found this web site as a finest web page for hottest updates.

Amazing! Its truly remarkable post, I have got much clear idea regarding from this paragraph.

Because the admin of this website is working, no question very quickly it will be renowned, due to its quality contents.

Appreciate the recommendation. Let me try it out.

Pages

Add new comment