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

I know this site offers quality dependent content and extra stuff, is there any other site which offers these kinds of stuff in quality?

Howdy! 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 covers a lot of the same subjects as yours and I think 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! Awesome blog by the way!

I like the valuable information you supply for your articles. I'll bookmark your weblog and test again here regularly. I'm moderately sure I'll be informed many new stuff proper right here! Best of luck for the following!

Hi there! This blog post could not be written much better! Reading through this post reminds me of my previous roommate! He constantly kept preaching about this. I am going to send this post to him. Fairly certain he'll have a good read. Thanks for sharing!

Hello there! I simply want to give you a huge thumbs up for the great information you've got here on this post. I'll be coming back to your blog for more soon.

What's up, everything is going nicely here and ofcourse every one is sharing facts, that's really good, keep up writing.

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

Pretty section of content. I just stumbled upon your blog and in accession capital to assert that I get in fact enjoyed account your blog posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently rapidly.

Wow, this paragraph is nice, my younger sister is analyzing these things, so I am going to let know her.

You actually expressed that exceptionally well. lucky start online casino online casino slots betus casino mГЎy tГ­nh online casino

I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get setup? I'm assuming having a blog like yours would cost a pretty penny? I'm not very web savvy so I'm not 100% certain. Any suggestions or advice would be greatly appreciated. Kudos

Hi i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought i could also create comment due to this brilliant post.

I'm gone to say to my little brother, that he should also visit this webpage on regular basis to take updated from latest information.

Appreciating the commitment you put into your site and in depth information you offer. It's awesome to come across a blog every once in a while that isn't the same old rehashed material. Fantastic read! I've bookmarked your site and I'm including your RSS feeds to my Google account.

First of all I would like to say terrific blog! I had a quick question that I'd like to ask if you do not mind. I was curious to know how you center yourself and clear your mind prior to writing. I have had trouble clearing my thoughts in getting my thoughts out there. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes tend to be lost simply just trying to figure out how to begin. Any recommendations or hints? Cheers!

Incredible tons of awesome tips casino chile online casino slots online real money gta online how to do casino heist

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

I am sure this paragraph has touched all the internet viewers, its really really pleasant post on building up new blog.

Hey there! I've been reading your web site for a while now and finally got the courage to go ahead and give you a shout out from Humble Texas! Just wanted to mention keep up the excellent work!

This is nicely put. . online casinos ia no deposit casino canada flamingo casino online slots

I blog quite often and I genuinely appreciate your content. This great article has really peaked my interest. I am going to book mark your site and keep checking for new details about once per week. I opted in for your RSS feed too.

This is nicely put red stag online casino real money online casino canada malaysia top 10 online casino

What's up friends, its wonderful piece of writing about cultureand fully defined, keep it up all the time.

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Thanks a lot An abundance of write ups empire casino free online games best online casino slot machines new online casino in pennsylvania

Hi there! Someone in my Facebook group shared this site with us so I came to give it a look. I'm definitely enjoying the information. I'm bookmarking and will be tweeting this to my followers! Outstanding blog and brilliant style and design.

Hey there! This is kind of off topic but I need some guidance from an established blog. Is it tough to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about setting up my own but I'm not sure where to begin. Do you have any points or suggestions? Many thanks

With thanks. Great stuff. 36win be online casino free casino online slots skycity online casino withdrawal

You really make it appear so easy with your presentation however I to find this matter to be actually one thing which I think I might never understand. It sort of feels too complex and very large for me. I am looking ahead for your subsequent post, I will try to get the grasp of it!

clomid for sale do i need prescription to buy zovirax coumadin ordered simultaneously heparin [url=https://coumadinshopx247.top/]cranberry pills coumadin interaction[/url] buy coumadin canada <a href="https://coumadinshopx247.top/">cranberry pills coumadin interaction</a> where to buy coumadin proscar 2024 [url=https://proscarshopx247.top/]buy proscar online no prescription[/url] buy propecia proscar <a href="https://proscarshopx247.top/">buy proscar online no prescription</a> buy propecia finasteride online cymbalta and pain pills [url=https://cymbaltashopx247.top/]cymbalta weight loss pills[/url] cymbalta and sleeping pills <a href="https://cymbaltashopx247.top/">cymbalta weight loss pills</a> cymbalta with sleeping pills where to buy zofran online [url=https://zofranshopx247.top/]buy zofran odt[/url] buy zofran online canada <a href="https://zofranshopx247.top/">buy zofran odt</a> ondansetron price buy zovirax cream genital herpes [url=https://zoviraxshopx247.top/]buy cheap zovirax usa[/url] buy acyclovir <a href="https://zoviraxshopx247.top/">buy cheap zovirax usa</a> can you buy zovirax at the supermarket order crestor online lopressor 50mg cleocin price Crestor

Everyone loves it when people get together and share ideas. Great site, keep it up!

Thanks a lot Plenty of info. casino vegas slots online new online usa casinos best 2019 australian online casino

Whoa! This blog looks just like my old one! It's on a totally different topic but it has pretty much the same page layout and design. Outstanding choice of colors!

Hi, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam responses? If so how do you reduce it, any plugin or anything you can advise? I get so much lately it's driving me mad so any support is very much appreciated.

It's difficult to find knowledgeable people in this particular subject, but you sound like you know what you're talking about! Thanks

Excellent blog post. I definitely love this site. Thanks!

Awesome advice. Many thanks. captain cooks online casino reviews canadian casino online 918 online casino

Pages

Add new comment