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

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

Fantastic goods from you, man. I have understand your stuff previous to and you're just too great. I actually like what you've acquired here, really like what you are saying and the way in which you say it. You make it entertaining and you still take care of to keep it sensible. I can't wait to read much more from you. This is actually a terrific site.

Thank you for any other magnificent article. Where else could anyone get that kind of info in such a perfect way of writing? I have a presentation next week, and I am on the look for such information.

I was curious if you ever thought of changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?

I have been browsing on-line more than 3 hours lately, yet I by no means discovered any interesting article like yours. It's pretty worth sufficient for me. In my opinion, if all site owners and bloggers made just right content as you probably did, the net might be a lot more useful than ever before.

Have you ever considered writing an ebook or guest authoring on other sites? I have a blog based on the same subjects you discuss and would love to have you share some stories/information. I know my readers would value your work. If you're even remotely interested, feel free to send me an email.

This info is worth everyone's attention. How can I find out more?

In fact when someone doesn't know after that its up to other people that they will assist, so here it takes place.

Hi friends, its fantastic piece of writing about tutoringand completely defined, keep it up all the time.

Can I simply say what a comfort to find a person that really knows what they're talking about online. You actually realize how to bring a problem to light and make it important. More and more people have to look at this and understand this side of the story. It's surprising you are not more popular because you definitely have the gift.

Your method of describing all in this article is truly pleasant, all can simply be aware of it, 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

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your webpage? My blog is in the exact same niche as yours and my users would definitely benefit from a lot of the information you present here. Please let me know if this ok with you. Thanks a lot!

I really like reading through a post that can make people think. Also, many thanks for allowing me to comment!

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

certainly like your website but you need to check the spelling on several of your posts. Several of them are rife with spelling problems and I in finding it very bothersome to inform the truth then again I'll surely come back again.

Hi there! 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 love it when people get together and share ideas. Great blog, continue the good work!

<a href=https://costarus.ru/>миграция в Коста-Рика</a>
<a href=https://costarus.ru/>Коста-Рика гражданство сша</a>
https://costavida.ru
<a href=https://imigrantos.ru>в Коста-Рика на пмж</a>
<a href=https://imigrantos.ru>в Коста-Рика на пмж из России</a>
https://costarus.ru
<a href=https://costavida.ru/>Коста-Рика гражданство преимущества</a>
<a href=https://costavida.ru/>вид на жительство в Коста-Рике для россиян</a>
<a href=https://imigrantos.ru>роды в Коста-Рика</a>
<a href=https://costavida.ru/>как получить гражданство Коста-Рики</a>
<a href=https://costarus.ru/>на пмж в Коста-Рику из России</a>
https://imigrantos.ru

I'm really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it is rare to see a nice blog like this one nowadays.

I was curious if you ever considered changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images. Maybe you could space it out better?

Hello There. I found your weblog the use of msn. That is a really neatly written article. I will make sure to bookmark it and come back to learn more of your helpful info. Thanks for the post. I'll definitely return.

hi!,I love your writing so much! proportion we be in contact more approximately your post on AOL? I require a specialist on this area to solve my problem. May be that's you! Taking a look forward to look you.

Hi my friend! I wish to say that this article is awesome, great written and come with almost all vital infos. I'd like to look extra posts like this .

<a href=https://costarus.ru/>гражданство Коста-Рики что дает</a>
<a href=https://costarus.ru/>как получить внж в коста рик</a>
https://costavida.ru
<a href=https://imigrantos.ru>внж Коста-Рика как получить</a>
<a href=https://costarus.ru/>гражданство в Коста-Рике получить</a>
https://costarus.ru
<a href=https://costavida.ru/>внж для пенсионеров в Коста-Рике</a>
<a href=https://costavida.ru/>получение гражданства Коста-Рики</a>
<a href=https://imigrantos.ru>пмж Коста-Рика отзывы</a>
<a href=https://costavida.ru/>на Коста-Рику на пмж</a>
<a href=https://imigrantos.ru>как получить внж в коста рик</a>
https://imigrantos.ru

I've been exploring for a bit for any high-quality articles or weblog posts in this kind of house . Exploring in Yahoo I finally stumbled upon this website. Studying this info So i'm happy to show that I've an incredibly good uncanny feeling I came upon exactly what I needed. I most indubitably will make certain to do not fail to remember this web site and give it a look on a continuing basis.

I really like looking through an article that will make men and women think. Also, thank you for permitting me to comment!

Greetings I am so thrilled I found your blog, I really found you by error, while I was browsing on Askjeeve for something else, Anyways I am here now and would just like to say cheers for a fantastic post and a all round enjoyable blog (I also love the theme/design), I don't have time to browse it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the fantastic job.

I don't even know how I finished up right here, however I thought this publish used to be great. I do not understand who you are however certainly you're going to a famous blogger for those who are not already. Cheers!

Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but other than that, this is great blog. A great read. I'll definitely be back.

Remarkable! Its truly awesome paragraph, I have got much clear idea about from this piece of writing.

My coder is trying to convince me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using WordPress on several websites for about a year and am nervous about switching to another platform. I have heard excellent things about blogengine.net. Is there a way I can transfer all my wordpress posts into it? Any help would be really appreciated!

<a href=https://costarus.ru/>Коста-Рика переезд на пмж из России отзывы</a>
<a href=https://costavida.ru/>пмж в Коста-Рику для россиян</a>
https://costavida.ru
<a href=https://costavida.ru/>Коста-Рику иммиграция</a>
<a href=https://costarus.ru/>иммиграция на Коста-Рике</a>
https://costarus.ru
<a href=https://costarus.ru/>роды в Коста-Рике гражданство для родителей</a>
<a href=https://costarus.ru/>как получить гражданство в Коста-Рика</a>
<a href=https://costavida.ru/>иммиграция в Коста-Рике</a>
<a href=https://imigrantos.ru>роды в Коста-Рике отзывы</a>
<a href=https://costarus.ru/>Коста-Рика на пмж отзывы</a>
https://imigrantos.ru

First off I would like to say terrific blog! I had a quick question that I'd like to ask if you don't mind. I was interested to know how you center yourself and clear your head before writing. I have had a hard time clearing my mind in getting my ideas out. I do enjoy writing but it just seems like the first 10 to 15 minutes are wasted simply just trying to figure out how to begin. Any ideas or hints? Thanks!

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your weblog? My website is in the very same area of interest as yours and my visitors would definitely benefit from some of the information you provide here. Please let me know if this ok with you. Thank you!

I must thank you for the efforts you've put in writing this website. I am hoping to see the same high-grade blog posts by you in the future as well. In truth, your creative writing abilities has inspired me to get my own site now ;)

Right here is the right webpage for anybody who would like to understand this topic. You understand so much its almost hard to argue with you (not that I personally will need to…HaHa). You definitely put a fresh spin on a subject that has been discussed for decades. Wonderful stuff, just wonderful!

I have been browsing online greater than 3 hours nowadays, but I never found any attention-grabbing article like yours. It's lovely worth enough for me. In my opinion, if all website owners and bloggers made just right content as you probably did, the internet will likely be a lot more useful than ever before.

Very good post. I definitely love this site. Continue the good 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

Good way of explaining, and pleasant paragraph to obtain information about my presentation topic, which i am going to deliver in academy.

Thanks in support of sharing such a good idea, article is pleasant, thats why i have read it completely

Pages

Add new comment