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

It's awesome to go to see this web site and reading the views of all mates regarding this article, while I am also keen of getting familiarity.

Do you have a spam problem on this website; I also am a blogger, and I was curious about your situation; we have created some nice methods and we are looking to trade techniques with other folks, please shoot me an e-mail if interested.

Hey there! I'm at work surfing around your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the superb work!

Appreciation to my father who told me about this blog, this blog is truly amazing.

It's fantastic that you are getting ideas from this piece of writing as well as from our discussion made here.

hi!,I like your writing very a lot! percentage we keep up a correspondence more approximately your article on AOL? I require an expert in this house to unravel my problem. Maybe that is you! Looking forward to see you.

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

I'm not sure why but this weblog is loading very 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.

Mastering The Crease is an engaging guidebook that delves into the intricate art of origami, offering enthusiasts and beginners alike a comprehensive exploration of folding techniques. Through clear instructions and vivid illustrations, it unveils the secrets behind creating intricate paper designs, from simple figures to complex masterpieces. Whether you're a novice seeking to perfect your skills or a seasoned folder looking for fresh inspiration, this book provides a roadmap to unlock the full potential of origami, making it an essential addition to any paper artist's collection.

Hi my family member! I wish to say that this article is amazing, great written and include approximately all significant infos. I'd like to peer more posts like this .
look at my page
https://zvukiknig.info/user/DonteMachado22/ crema per dolori articolari
https://affiliates.trustgdpa.com/farmaci-per-dolori-articolari-cose-da-s... pomata per dolori articolari naturale
http://camillacastro.us/forums/viewtopic.php?id=271832 crema per dolori articolari gel
https://www.ofurea.com/CesarSweet36457 creme per dolori articolari
https://howis.info/2024/04/10/il-5-second-trucco-per-dolori-articolari-c... dolori articolari cosa sono

@776=

It's not my first time to pay a quick visit this web site, i am browsing this website dailly and get good data from here all the time.
look at my page
http://www.soccer-manager.eu/forum/profile.php?id=1773483 crema per dolori articolari gel
https://www.shufaii.com/thread-157687-1-1.html crema cinese per dolori articolari
http://bbs.ts3sv.com/home.php?mod=space&uid=265071&do=profile pomata per dolori articolari naturale
https://academy.theunemployedceo.org/forums/users/rtomarietta/ pomata per dolori articolari naturale
https://learning.lgm-international.com/forums/users/shannanshell/ dolori alle articolazioni rimedi

@776=

If you would like to increase your know-how simply keep visiting this web site and be updated with the latest news posted here.

Nice post. I learn something new and challenging on blogs I stumbleupon on a daily basis. It's always interesting to read through content from other authors and use a little something from other websites.

I think this is one of the most important information for me. And i'm glad reading your article. But wanna remark on few general things, The site style is great, the articles is really nice : D. Good job, cheers

I was able to find good information from your content.

Good web site you have got here.. It's hard to find good quality writing like yours these days. I seriously appreciate individuals like you! Take care!!

Hey! I realize this is somewhat off-topic but I had to ask. Does building a well-established website such as yours require a large amount of work? I'm brand new to blogging but I do write in my diary daily. I'd like to start a blog so I will be able to share my experience and views online. Please let me know if you have any kind of ideas or tips for new aspiring blog owners. Thankyou!

Do you mind if I quote a few of your articles as long as I provide credit and sources back to your webpage? My blog is in the very same area of interest as yours and my users would genuinely benefit from some of the information you present here. Please let me know if this okay with you. Thanks!

Peculiar article, totally what I was looking for.

What's up, I would like to subscribe for this webpage to get latest updates, so where can i do it please assist.

Hi!
Earn every MINUTE without limit of 100, 200, 500, 1000 and whiter Dollars USA, there are NO limits!

We have been trusted by millions of people around the world since 2014!
The most convenient platform for online trading and investment 2023!
*Awarded by FxDailyInfo, a reputable international resource!
*World Business Outlook Award!
The most reliable financial broker 2023!

+ Instant withdrawal!
+ Demo account +10 000D!
+ Free Signals!
+ Free training!
+ PROMO-CODE: OLYMPOLYMP
*From $50 +30% to deposit!

WARNING! If registration is closed for your country, you need to enable VPN and choose a country from which registration is not prohibited, for example (Singapore).
After registration you can disable VPN and start earning, it is allowed!

Sign up, and earn unlimited earnings every 60 seconds!
The promo code is valid on these links only!

DOWNLOAD IOS APP (App Store)
https://app.appsflyer.com/id1053416106?pid=affiliate&c=101773&af_siteid=...

DOWNLOAD ANDROID APP (Google Play)
https://app.appsflyer.com/com.ticno.olymptrade?pid=affiliate&c=101773&af...

WEB VERSION
https://trkmad.com/101773/

Hi, I do think this is an excellent website. I stumbledupon it ;) I am going to return once again since I bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

Hi there to every one, because I am genuinely keen of reading this blog's post to be updated regularly. It includes good stuff.

Thanks for finally writing about > %blog_title% < Liked it!

Generally I do not learn post on blogs, however I wish to say that this write-up very compelled me to take a look at and do it! Your writing taste has been amazed me. Thank you, very great article.

Hi!
Earn every MINUTE without limit of 100, 200, 500, 1000 and whiter Dollars USA, there are NO limits!

We have been trusted by millions of people around the world since 2014!
The most convenient platform for online trading and investment 2023!
*Awarded by FxDailyInfo, a reputable international resource!
*World Business Outlook Award!
The most reliable financial broker 2023!

+ Instant withdrawal!
+ Demo account +10 000D!
+ Free Signals!
+ Free training!
+ PROMO-CODE: OLYMPOLYMP
*From $50 +30% to deposit!

WARNING! If registration is closed for your country, you need to enable VPN and choose a country from which registration is not prohibited, for example (Singapore).
After registration you can disable VPN and start earning, it is allowed!

Sign up, and earn unlimited earnings every 60 seconds!
The promo code is valid on these links only!

DOWNLOAD IOS APP (App Store)
https://app.appsflyer.com/id1053416106?pid=affiliate&c=101773&af_siteid=...

DOWNLOAD ANDROID APP (Google Play)
https://app.appsflyer.com/com.ticno.olymptrade?pid=affiliate&c=101773&af...

WEB VERSION
https://trkmad.com/101773/

It's remarkable to go to see this website and reading the views of all colleagues concerning this piece of writing, while I am also keen of getting familiarity.

Way cool! Some very valid points! I appreciate you penning this write-up and also the rest of the website is also really good.

I do not know whether it's just me or if perhaps everyone else experiencing problems with your site. It looks like some of the written text in your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well? This might be a problem with my browser because I've had this happen previously. Thanks

Thanks for your personal marvelous posting! I actually enjoyed reading it, you will be a great author. I will be sure to bookmark your blog and will come back someday. I want to encourage you to continue your great work, have a nice afternoon!

Hey, I visited your site and I think that your content is amazing! It is really engaging and original, you must have worked so hard to generate such a quality content.

My name is Natasha from ForeMedia and I help website owners with great websites to maximize the revenue they make from their website.

I would love to buy Ad Spaces on your website and pay you per each impression of the ads on your site. We are Google Ad Exchange Premium partners and we work with more than 100 Ad Network & thousands of premium direct advertisers who would LOVE to buy Ads directly from your site and we can guarantee to increase your revenue by at least 45% compared to other advertising solutions you are currently using.
You deserve to earn more for your content and maximize your earning potential and I will help you unlock that potential!
There is no cost, you can register to our monetization platform for free on this link: https://foremedia-ads.net
I will be available for you on the Live Chat if you need any help, or you can email me back to: natasha@foremedia-ads.net if you have any questions.
I have at least 17 Premium Advertisers that have asked me to approach you because they would like to advertise on your website on Premium eCPM <cost>per impressions] basis.
Have a good day & feel free to ping me for any question!
Click the link here for 1 minute registration to our platform <it>s free!]: https://foremedia-ads.net
ForeMedia - Earn Money With Your Website
https://foremedia-ads.net

Hi there! This is my 1st comment here so I just wanted to give a quick shout out and say I truly enjoy reading through your articles. Can you recommend any other blogs/websites/forums that go over the same topics? Thanks a ton!

Hi, Neat post. There's a problem along with your web site in web explorer, may check this? IE still is the market leader and a big component of other folks will leave out your fantastic writing due to this problem.

For hottest news you have to pay a quick visit world wide web and on world-wide-web I found this site as a finest website for hottest updates.

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

Fine way of describing, and nice post to take data concerning my presentation subject, which i am going to present in academy.

I just couldn't go away your website prior to suggesting that I extremely enjoyed the standard info an individual provide for your guests? Is gonna be back continuously in order to check out new posts

Howdy! I simply wish to offer you a huge thumbs up for your excellent information you've got here on this post. I am coming back to your site for more soon.

It's hard to find well-informed people for this subject, but you seem like you know what you're talking about! Thanks

I'll immediately seize your rss feed as I can not in finding your e-mail subscription link or newsletter service. Do you have any? Please let me understand in order that I may just subscribe. Thanks.

Pretty great post. I just stumbled upon your weblog and wanted to say that I've truly loved browsing your weblog posts. In any case I'll be subscribing to your feed and I'm hoping you write again very soon!

Great blog! Do you have any recommendations for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything. Would you advise starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm completely confused .. Any ideas? Appreciate it!

I'm truly enjoying the design and layout of your website. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Exceptional work!

Hi!
Earn every MINUTE without limit of 100, 200, 500, 1000 and whiter Dollars USA, there are NO limits!

We have been trusted by millions of people around the world since 2014!
The most convenient platform for online trading and investment 2023!
*Awarded by FxDailyInfo, a reputable international resource!
*World Business Outlook Award!
The most reliable financial broker 2023!

+ Instant withdrawal!
+ Demo account +10 000D!
+ Free Signals!
+ Free training!
+ PROMO-CODE: OLYMPOLYMP
*From $50 +30% to deposit!

WARNING! If registration is closed for your country, you need to enable VPN and choose a country from which registration is not prohibited, for example (Singapore).
After registration you can disable VPN and start earning, it is allowed!

Sign up, and earn unlimited earnings every 60 seconds!
The promo code is valid on these links only!

DOWNLOAD IOS APP (App Store)
https://app.appsflyer.com/id1053416106?pid=affiliate&c=101773&af_siteid=...

DOWNLOAD ANDROID APP (Google Play)
https://app.appsflyer.com/com.ticno.olymptrade?pid=affiliate&c=101773&af...

WEB VERSION
https://trkmad.com/101773/

Pages

Add new comment