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

Howdy! Do you know if they make any plugins to safeguard against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?

I think this is one of the most vital info for me. And i'm glad reading your article. But should remark on some general things, The site style is perfect, the articles is really great : D. Good job, cheers

Its like you learn my thoughts! You seem to know a lot approximately this, like you wrote the e book in it or something. I think that you can do with a few percent to drive the message house a little bit, but other than that, that is excellent blog. A fantastic read. I'll definitely be back.

If you are going for most excellent contents like myself, simply go to see this site all the time since it offers feature contents, thanks

Aphid spray for indoor and outdoor plants and vegetables in Port Chester is a specific item intended to target and control aphids, little insects that can harm plants by feeding on their sap. Regularly containing insecticides or anti-agents explicitly formulated to battle aphids, this spray is reasonable for use on both indoor and outdoor plants, as well as vegetables. By actually eliminating aphids and preventing their infestation, this spray shields plants and vegetables from harm, ensuring solid development and improvement. It fills in as an important device for nursery workers and cultivators in Port Chester, aiding in the administration of aphid infestations and supporting the development of thriving plants and vegetables.

Currently it looks like Movable Type is the top blogging platform out there right now. (from what I've read) Is that what you're using on your blog?

Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something informative to read?

I am not sure where you're getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for fantastic info I was looking for this info for my mission.

Thank you for sharing your thoughts. I truly appreciate your efforts and I am waiting for your next write ups thanks once again.

Presenting the embodiment of extravagance and warmth: our cashmere winter scarf. Created from the best cashmere filaments, obtained for their unmatched delicateness and protection, this scarf is your definitive ally for conquering the cold winter days in style. Enclose yourself by liberal solace as the rich cashmere tenderly hugs you, giving a comfortable boundary against the gnawing cold. Its immortal plan and wonderful craftsmanship make it a flexible extra that easily raises any winter gathering, whether you're going to work or out for a relaxed walk. Embrace the unrivaled tastefulness and unequaled warmth of our cashmere winter scarf, and rethink your winter closet with complexity and extravagance.

Wonderful work! This is the type of info that are meant to be shared around the internet. Disgrace on Google for no longer positioning this post higher! Come on over and discuss with my web site . Thank you =)

Awesome website you have here but I was curious about if you knew of any discussion boards that cover the same topics discussed in this article? I'd really love to be a part of online community where I can get comments from other experienced people that share the same interest. If you have any recommendations, please let me know. Thank you!

I loved as much as you'll receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this hike.

Admiring the hard work you put into your site and in depth information you offer. It's great to come across a blog every once in a while that isn't the same out of date rehashed material. Excellent read! I've saved your site and I'm including your RSS feeds to my Google account.

My spouse and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i'm following you. Look forward to finding out about your web page yet again.

Simply desire to say your article is as amazing. The clearness to your publish is simply nice and that i could assume you're an expert on this subject. Fine with your permission allow me to snatch your feed to keep updated with impending post. Thanks 1,000,000 and please continue the gratifying work.

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

Pretty! This has been a really wonderful article. Many thanks for providing these details.

I was very pleased to find this web site. I need to to thank you for ones time for this fantastic read!! I definitely really liked every bit of it and I have you bookmarked to see new things on your blog.

Your style is very unique in comparison to other people I have read stuff from. Thanks for posting when you have the opportunity, Guess I'll just book mark this page.

This paragraph presents clear idea in favor of the new viewers of blogging, that truly how to do blogging.

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

Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You definitely know what youre talking about, why throw away your intelligence on just posting videos to your site when you could be giving us something enlightening to read?

Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you helped me.

Do you have a spam issue on this site; I also am a blogger, and I was wondering your situation; many of us have developed some nice procedures and we are looking to exchange strategies with other folks, be sure to shoot me an email if interested.

When I initially commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I receive 4 emails with the exact same comment. There has to be a means you can remove me from that service? Thanks a lot!

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

Excellent post. I was checking constantly this blog and I'm impressed! Extremely helpful info specifically the last part :) I care for such info much. I was looking for this particular information for a long time. Thank you and best of luck.

Hi, I think your blog might be having browser compatibility issues. When I look at your blog in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, terrific blog!

Hi! I simply want to give you a big thumbs up for the great info you have got here on this post. I will be coming back to your site for more soon.

Pretty! This has been an incredibly wonderful article. Thank you for supplying this information.

We're a bunch of volunteers and opening a brand new scheme in our community. Your web site offered us with valuable info to work on. You've done an impressive job and our whole group will be thankful to you.

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

I'm gone to say to my little brother, that he should also pay a quick visit this web site on regular basis to take updated from most up-to-date information.

Hey! I know this is kinda off topic but I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa? My blog covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you are interested feel free to shoot me an e-mail. I look forward to hearing from you! Terrific blog by the way!

you are really a excellent webmaster. The website loading speed is amazing. It sort of feels that you are doing any unique trick. Moreover, The contents are masterwork. you've done a great job in this matter!

An impressive share! I've just forwarded this onto a coworker who had been conducting a little homework on this. And he in fact ordered me lunch because I found it for him... lol. So allow me to reword this.... Thank YOU for the meal!! But yeah, thanx for spending some time to discuss this subject here on your site.

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

Hello, of course this post is truly good and I have learned lot of things from it concerning blogging. thanks.

I do not even understand how I finished up here, but I believed this post was once good. I do not understand who you are but certainly you're going to a famous blogger if you are not already. Cheers!

Thanks for sharing your thoughts about %meta_keyword%. Regards

Hey just wanted to give you a brief heads up and let you know a few of the images aren't loading correctly. I'm not sure why but I think its a linking issue. I've tried it in two different browsers and both show the same outcome.

Its like you read my thoughts! You appear to understand so much about this, such as you wrote the book in it or something. I think that you just could do with a few % to pressure the message home a bit, however instead of that, this is excellent blog. A great read. I'll definitely be back.

I think this is among the most important info for me. And i am glad reading your article. But should remark on some general things, The web site style is wonderful, the articles is really excellent : D. Good job, cheers

Pages

Add new comment