Best Practice Site Architecture in Drupal 8

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good morning everyone and welcome to today's webinar best practice site architecture in Drupal 8 how to make the right decisions for your development plan your speakers for today are matt cheney co-founder here at pantheon along with our guest speaker mark curry director of engineering at chapter 3 just a few housekeeping items to go over before we start please make sure you submit any questions you have during the presentation in the question window or tweet them at get pantheon we will answer as many of the questions as we can during the Q&A portion of today's presentation also this webinar will be recorded and the recording will be made available to everyone next week I now like to turn it over to Matt and mark hello everyone welcome to the webinar my name is Matt Chaney I'm one of the co-founders here at Pantheon and I've been doing web development for the last 10 years very excited about Drupal 8 of course and all of the new opportunities it provides us an decided to talk about some tips and tricks for using Drupal 8 and building really awesome site architecture here with Mark today I am mark 3 I'm the director of engineering at chapter 3 been building Drupal sites for a really long time and now I oversee all of our Drupal projects and help with the architecture side of things in particular and we both um you know are pretty knowledgeable about web development and Drupal 8 specifically and so we're gonna reserve a lot of the time or reserve some time here for Q&A at the end so we have a chat window where you can pop up questions and we'll sort of save the save some for the end we can answer some in line but you know everyone sort of still figuring this out that Drupal 8 is I think sort of having the dawning of its of its glory age we've been out with over a year of Drupal 8 we now have a hundred and sixty-eight thousand site sort of using it in the wild which is a significant increase over a year ago this time got a three times increase and you know both mark and myself have spent a lot of time through chapter three and Pantheon working with with Drupal 8 and seeing a lot of different projects that have come through you know as Mark said he's you know they have a ham do a lot of Drupal 8 development at chapter 3 author 2 projects running on Drupal 8 and have a lot of experience with that and here at Pantheon sort of since the beta we've been hosting Drupal 8 on our platform and over 20,000 people have sort of spun up Drupal 8 sites and and tried out the the different technologies I think that like people have been met with like a mix of success in terms of you know building really awesome stuff just struggling and I think a lot of sort of what we're trying to do in this webinar and across a lot of sort of education the community is get people sort of aware of what Drupal 8 it's good for what kind of things that can be used to be really excellent to do and where you where some of the pitfalls are so I think what I think about Drupal 8 I really am trying to think about it sort of on its own terms that I think Drupal 8 is absolutely ready for production has been so for a long time and that you know everyone she will confident building sites on it today that this is something that you know we see a lot of a lot of successful outcomes when people use Drupal 8 but I think the biggest switch and if you're sorta gonna take one thing away from this webinar I think this is maybe maybe yet which is that unlike Drupal 7 or Drupal 6 where if you had a sort of need for something you would sort of you know try to find a quote module for that that isn't necessarily gonna be occasioned Drupal 8 that there's a lot of things in Drupal 8 that you know you don't need modules for because the core system is actually far more powerful than it's ever been before and you can do a lot of things just in the Drupal core David Strauss our CTO at Pantheon and myself had a talk at last year's Drupal con on agile v8 builds where we actually build a whole lot of really complicated sites just using core Drupal 8 technology so you don't need modules in that case you also in the case Drupal 8 like because of the more advanced twig sort of templating system you end up not needing as many sort of helper modules to build little slideshow features or little widgets on your page that you can do a lot of that just in the theme so you're not actually extending other other kinds of code and I think that that's that's good that part of the architecture of Drupal 8 means that my with very small amounts of code you can develop routes or do complicated templating and you don't necessary need a lot of modules to get things done and a lot of you're just gonna be happier using core like people people are struggling to figure out these Drupal 8 design patterns and their controls and sometimes contribute is a little bit rough and if you're using core that codes already then you know put through its paces for a couple of years now so you'll be much happier if you use used core as much as you can yeah and I think that's from the successful projects we've seen that's really been the philosophy and that would be the one I would sort of emphasize Martin I would emphasize today and I think you know sort of in that case like Drupal 8 core features specifically its content management features are absolutely ace that you can model content create custom block types build really complicated entities in ways that like you were never able to do before and can really model any kind of content that you're sort of trying to produce on the web and sort of add to that this sort of templating system where you can you know easily sort of export out individual elements of that content and you have a lot of power right there in the drupal a core system and I think when we think about architecting Drupal 8 sites the way and we'll talk we're gonna run through a development plan show off some some example sites in a minute but a lot of the sort of thinking is if you can just get the content model right and you can get the page model right and you can sort of start to define it that way that's 80% of the work you need to do you can do almost all of that in core and then yeah you'll fill the edges with some custom code that do the architecture but getting that core content management piece right save you all sorts of time I think that's what I think about Drupal 8 sort of architecture I just wanted to start there for the webinar in terms of thinking about it so if that all four over to mark to sort of talk about some of the ideas and some best practices and some sort of user stories about how to use how to use Drupal 8 so anybody here who's try to use dress make and Drupal 7 probably you know feels like this guy new dress made was a Drupal specific tool to solve a problem that you know was definitely there and you know we didn't have the luxury of using any other tools to accomplish those kind of tasks and Drupal 7 so next slide the PHP community has finally developed a package manager that people actually want to use with composer and with Drupal 8 the whole system's build around composer core is built using composer and so what people have realized is that the more you rely on composer for your build the easier these things are the more reproducible these things are and so there's a tool out there called composer patch manager that for me does all of the important parts that combined with composer does all the important parts that rush make which is I can manage patches and like I said you know da contribute might be a little bit of rust so you are going to be managing patches I would say that this has increased decreased greatly over the last year like at the beginning of 2016 chapter Bree decided we're going to build all our new projects in Drupal 8 and the number of patches we have to maintain has definitely decreased over that year so I think contribute is getting more and more solid every day and people are actively committing these patches but you're still going to have rough patches and this gives you a really easy tool that to manage those patches and so don't be afraid to use composer and don't be afraid to you know build your Drupal 8 project using composer especially while you're in the development phase of the project yeah I would definitely echo that I think from an architecture standpoint making sure you've got all the required code not only from Drupal core and contribute external PHP libraries I think those are important parts of building really good projects or to have the most up-to-date kind of stuff all together bozer really love to put it together and by using the patches stuff to increase you can do basically everything you did and rush make but better so switching the role to the site owner I have gotten this request a bunch of times from different types of clients into certain industries they really don't want you to be able to change production in the way production works or to be able to bring down production from the admin UI so in Drupal 7 I didn't really have a good solution to this other than rewriting people's password hashes when we move the database up to prod the Drupal age with configuration management we get a much better solution so config read only is it's part of a class of modules that I've been really excited to watch for Drupal 8 so um you know if you go looking for that same d7 contribute that you've always used you may not find it or you may not be happy with the status end but if you go look for a DHS diffic module you can find some really awesome things that are are only available because of you know the power behind your plate so with configuration management just to do a little recap of that like every piece of config every check box you check in Drupal is now captured in the ammo files and so what that means is I now have two during my architecture phase think about how I'm going to be managing that and say come up with a system like is it going to be contribute if they're going to be committed to the git repo or are we going to you know store it somewhere else so it's read and write or in this case are we going to lock it down so that when I click a check box on production I get this nice message that says this form can't be saved because configuration is read-only and so what that means is the only way I'm going to be able to make a change to production is moving code after production which you know in the right type of industry the right type of environment that can be hugely powerful and it also for me like managing client expectations is a big part of my job and when you see a message instead of just making that change and then having it overwritten the next time code gets deployed from stage I would say most of the DEA projects we work on we're overriding production config every time we deploy to production and so that means if you don't have a module like this in place you're merging changes you're sending emails to people asking them did you mean to change the title of that view or was that an accident so I would say you need it you need to config strategy and that should be planned really early in the project and like all of the developers involved in the project should be sitting in on that to agree on that config strategy yeah I definitely +1 this approach I think it forces you at an architectural level to get your config right early on and doesn't allow you to sort of like cheat I like changing it quickly on the live environment that this is a sort of disciplined approach to development and all it takes is one little module and a settings dot PHP flag and you're good to go so I think one of the features of Drupal 8 that kind of flown below the radar is the improved testing in Drupal 8 anybody that trying to write tests and Drupal 7 got a little frustrated that in Drupal 8 like writing tests is much easier the core test coverage is huge like far greater than we've ever had in Drupal and the new ability we have which is actually really recent I think of out of 81 is the ability to write javascript tests just using PHP which I know it sounds weird but if you look at the next slide you can see an example it's not as weird as it sounds and so what you're doing is it's something that looks a lot like the Hat but it actually allows you to change the JavaScript behavior of the page so in this example we're setting set sessions and we're testing sessions but you can also do Ajax calls from this kind of code so what it means is you're writing the same kind of test no matter what you're interacting with and as a person writing test I need to worry less about what's going to work and more about the behavior of the page and what I expect which is what you should be really doing when you're writing tests is you know testing behavior testing functionality not worrying about like working around some crazy core subsystem and how it functions to write your tests and make your test function properly and so I would say writing tests for d8 is far far easier than it ever has been interval yeah I think like one of the things we see a lot at Pantheon is working with different agencies they're much more interested in writing tests for their software now than ever before and that this is something that I think be you know making them really complicated comes difficult because you have to spend time and energy to develop the task that comes out of your project budget and you know if you can't see the ROI immediately it's sort of hard but if you're able to have you know really easy to write a stuff like this that can you know quickly tasks all sorts of functionality or site you can run that you know on every code commit on every deploy and get a lot of value quickly and I think it's awesome to see Drupal eight being that even easier for JavaScript as well so jumping away from the you know the other roles going to the seamer role I feel like femurs are getting you know huge benefits and what's change about the theme layer in Drupal 8 and so this is a super common request I get it on almost every project it's you know but sometimes it's not even as simple as this description it's like only on a few pages they said these ones in these situations and so with twigs instead of having to you know respond to that request in the UI like putting in a tool that allows you to you know change template behavior on demand you can also manage this and templates really quickly and easily so if you look at the next slide I got some code examples from using o so we've got a screen shot first and so you know this just explains you know when you might need to use this you know on a 404 page I want to show as little as possible because I might be serving up a lot of those so for performance reasons I'm just going to drop the sidebar the header and maybe even the footer so on the next slide we get an intro to twig block so twig blocks are an inheritance system for twig templates there's actually multiple systems in place I've actually got a developer working on a blog post right now to try to explain all the different twig inheritance systems but blocks are the most simple and straightforward and I think really everyone writing da things is going to learn to love them and start using them heavily if you look at the next slide the code makes it simpler than the description so this this is the 404 page so I extend my normal page template the one I use on everywhere in the site and all I do is return an empty block for the sidebar and if you go to the next slide you can see that this is what the sidebar would normally contain and this is what it contains in the parent template and all I had to do to draw all of that is just return that empty block and so in some cases I may be returning something very different like a very different style of sidebar but if there's something that only needs to display on certain pages just returning an empty twit block means I can use inheritance where I want it and override it where I need to and do that in a really fine grain way like a lot of the templates I've looked at to find examples had like six or seven different blocks set aside you know for different important areas of the page one of the steamers I was talking to about this described it as a kind of a replacement for regions you really don't even need to think about regions anymore because you can have like a well-designed block system that replaces that yeah and this I think really is gonna you know it really speeds up a lot of development projects that does happen using using Drupal 8 makes a code to actually do it a lot simpler that you know for these two examples that are being shortened like this is easy to understand doesn't require a lot of Drupal isms and a lot of weird things to make work it's sort of very readable very understandable very hackable which i think is a nice nice feature to it and when this Drupal is done very well with so let's run on that line of making architecture pleasurable and definitely those are a hardy aidid slide in here since we are talking about architecture is that you know sort of a lot of what we're trying to do when we're architecting Drupal 8 sites is you know make the right decisions for actually building the sites and then build it in the right way and there's a lot going on here I mean architecture for Drupal 8 you know is in some cases weeks of project time to get right but I think you know we're trying to highlight some of the high level kind of things that people are truly interested in sort of improving I think one area that you know is gonna be on top of all of our minds is how to sort of interact with the contribs space and Drupal 8 that you know when you're doing an architecture plan you're thinking about you know what features can we build and sort of in what way can we build them and I think for those who have been doing through or for a while turning to contribs and that's something that I think you know we talked a little about this earlier where Mark and I were sort of sharing that not every you know feature needs its own contribu can do a lot of core and I think that's right well I think also sort of when you're thinking about it you are gonna need to use sun can't read as part of your projects and I think that sort of you know after a year of Drupal 8 being out obviously a lot of stuff has been updated Incan trip but I would share I'm sure mark would agree that like there's the consistency of sort of what is you know the quality it can vary a lot and not necessarily in a way that tracks its official sort of release release schedule that sometimes a dev branch with no release is a better route sort of contribution and something that has a 100 release and so one of the things that I find really helpful is when you're sort of doing our picture plan to try to like identify the areas where custom code is definitely gonna be needed and when that happens turn around and basically say okay you know is this something I can do in core custom code or is this something it needs to contribute in trim module I think sort of the way that you know Mark and I were talking before the webinar is look at the control care maybe a little bit about the release of it how many people are using it but one thing to really dive into is look at the code for the release module for the module and see how much sort of Drupal 8 site our Drupal 8 architecture is used in the module are they using a lot of you know Drupal 8 patterns does it look like code that's more consistent with Drupal 8 and that's something that I think if if you see a lot of Drupal 8 isms in the code I think there's a lot of confidence that's gonna be a good sort of integration into your stuff sometimes you'll see things that work in Drupal Drupal 8 but they're sort of just sort of have wrappers around Drupal 8 stuff and still maintain a lot of other legacy Drupal 7 code those can still work of course I think the more Drupal 8 native the module is the stronger it is and I think an architecture perspective finding those kind of things than doing quick little spikes in your development planning to see if stuff works definitely gives you more truth beauty and wisdom one strategy that I use there as well is looking at the author of the module and clicking through their profile and looking if they have core commits because working on core is the best way to learn these patterns the core is really defining these patterns and so if somebody has done a lot of work in core and then cranks out a module or cranked out a release for a module you can rely on that being you know following Drupal a design patterns well and you know using the right core API and so I think that I'm paying more attention to the name of the person that's done the most recent work than I used to in Drupal 7 yeah very very important of course once you actually get into a situation where you're trying to use modules and sort of figure out what's good I think you're gonna eneded doing a little bit of debugging and this is something that doesn't truly I can architectural kind of challenge but I think one thing that anyone who sort of as a lot of architecture will tell you is that you do need to do a lot of testing of stuff when you're sort of going through the architectural planning so like thinking through you know what contribute you need to start to try to test and debug them or if you're working on custom code figuring out how to like get stuff to work and so the you know sort of just quick sort of tip I would throw out there is that actually Drupal out of the box doesn't shift doesn't ship with any sort of development stuff turned on you know you you have caching turned on by default you have CSS and JavaScript are occasional you don't have the the development services animal stuff included by default twig doesn't exist by default in the debugging mode and so you have to turn all of these things on and this is stuff that I think just you know some people struggle with they're first starting out with a Drupal 8 project hey how do I see the errors how do I see the right debugging stuff putting all this stuff is the way to do it and if this is something sort of just us where there's a shout out Zakia over at chapter 3 is doing a presentation I drew poke on Baltimore 15 ways to debug Drupal 8 for front Enders that I think will help hope you really sort of figure out a lot of these kind of best practices and that part of good architecture is making good choices and figuring out good choices requires some some deep and that's also true sort of not only on the front end kind of level with twig but also on the back end we're figuring out sort of you know what route goes to what piece of code that you know if you're trying to sort of say how I'm looking at I can trim or aloud is this work I want to figure out sort of what this what path corresponds to what sort of executable code in like you know previous world you might like look at like you know menu hooks and try to figure out what the arrays map to Drupal eights a little more complicated of course and so one tool that I find really helpful is using the Drupal console application it's a really great tool that will list out a bunch of routes for you by doing Drupal router debug it'll show you every single round the system at what code is actually being executed and that's a good way to sort of you know quickly quickly dive in and figure it out figure out what's going on think about routes is that it's terminology that every other framework including front-end frameworks uses and so once you start thinking about things as routes and you know learning that aspect of symphony you know it helps you in other systems as well so it so it's it's not Drupal specific knowledge it's not a dribble ISM you know like you're saying the menu hooks and so it's everything backend da developer you talk to is going to talk about routes all the time like it's going to come up in discussions all the time but you know luckily it's you know more broadly used knowledge that you that you're gaining by thinking about things this way true story on the twig debugging side of things we sort of showed you before a sort of turn it on I think as I said you can do a lot of architecture in Drupal eight sites just through the the theme template a lot of flexibility to sort of customize different areas of the site and different kinds of things but figuring out what what overrides what and what templates you should use can certainly be a challenge turning on debug mode and twig gives us this kind of breakdown where you can see individual areas where this is the file name you would have to write to override this piece or this is where you can actually see the core core template that's being used on stuff like that and that makes this kind of work really really easy it's even easier to shout out to Arshad who has this really awesome chroming template sort of helper where you turn on this and in Google Chrome it'll actually show you where individually like in the code where what template suggestions are for which things and you can copy them directly and then put them into your own custom files and this is something that actually works really well to actually figure out how to how to sort of create the right sort of front-end architecture by finding what templates need to be overridden to actually build the sort of site of your dreams a couple other just little you know one other just debugging tip I just threw in there was one of the things I'm sort of doing little spikes to figure out what stuff's good for architecture is I'll actually use the Drupal watchdog which exists in for plate I just requires you to use sort of slightly different syntax to log stuff to the watchdog you can use that to actually get information and sort of see what's going on and I think that's helpful like you got a lot of stuff Andrew blade is new a lot of things you're sort of trying out and experimenting I think that's important part of site architecture and having good debugging techniques makes a lot of sense so shifting gears a bit sort of talking about sort of the admin architecture I think one of the things that can get overlooked and a lot of projects that happen is sort of what actually needs to be architected on the back end what user stories are you gonna meet for administration and what is that gonna sort of look and feel like that um one of the things that we've sort of seen is that over the years Drupal has gotten a lot better on the back end which is excellent and a lot of the things that maybe previously you had to do development work to do like figuring out you know how to set up a WYSIWYG or building sort of a nice admin menu or or using views to actually manage the administration of content those are all now in core so you don't have to do as much but I think you still want to sort of think through what what are your sort of like you know our architecture challenges for the backend you know what kind of you know workflow operations need to actually be determined for for the content that's going through what sort of dashboard need to be built for individual use cases you know and what kind of custom design needs to happen for those administration experiences and I think you know for this sort of architecture plans that I that I work on and see you know having a section for admin and thinking very critically about that can really mean the difference between a project that gets used a lot by the end users and the people the site owners that use it or one that doesn't actually get used as much and then Drupal is so powerful for the end user to change you know to might manage their content that just you know some small amounts of views and you know dashboard configuration can go a really long way and that's something I think that can make a lot of sense for an orchestra plan to really plan for that and make sure that stuff works really well and I would say just from a client management perspective teasing out the types of administrators that are going to be using the system is sometimes more difficult than like learning about the you know front end users like the anonymous users so you know you really have to ask a lot of hard questions about who's logging and what permissions do they have what type of things do they edit like what kind of time do they have to actually work in the CMS to like answer these like admin questions you know I also think you know sort of page layout as architecture is something to really think about we can talk a little bit the QA may be about sort of panels and page layout but I think you know we're going to have the specific technical solution you need to do I think sort of figuring out what kinds of like layouts are gonna be used and how you're gonna build those is a really important part of site architecture you know a lot of a lot of Drupal 8 Drupal sites I see team that can get a little bit overly complicated is one where they sort of you know maybe started with a certain set of templates or layouts and then sort of tried to hack around those to like build more complicated things and then try to like change those up to do other kind of complicated things and you can really spend a lot of a lot of time working and sort of reworking those kind of layouts and I think if you can nail your templates down from the beginning and get a sort of really consistent model for how each all the theme is going to be organized things are so much easier to do down the road and much easier to sort of change around and that you know well this might just sort of seem like oh is just what the front Enders do to implement some designs I think it's more figuring out what kind of breakdown is gonna exist and there's real architecture work that has to happen there because asking people the sort of you know change stuff around willy-nilly can be really difficult and can affect for the outcome in a meaningful way but having a consistent plan works like these are the templates we're gonna have here's how our contents gonna fit and our widgets are gonna fit into that kind of template can really save you a lot of time it'll also make for a more sort of sustainable and long term project that people are going to use I'm long run which is great and I would add consistency on a Matt Matt said it a lot there but consistency is the key to ticket system and stick with it and stick with it not just after the site's built but you know after it's built and you're maintaining it you know don't add a display suite and like while the site is and maintenance like you know in addition to panels if you didn't have a display suite there from the beginning because then it's gonna be a little bit of an anti-pattern when you find it in the site because it's only to be used in one small area so you know just pick an approach get everybody buy-in from everybody on that approach and make sure that if that same approach is used consistently you know you're not solving one problem with one tool in one section of the site and another tool in another section of this a true story all right so that I mean those are some high level tips we refer to having about architecture there's obviously a lot to sort of go in on that but I think one of the things we wanted to really turn our attention to is for just do a few little snippets of how do you build stuff in Drupal 8 these are some screenshots of some of some sites that sort of Mark and I have have looked at and you know sort of to give a little bit of sort of opinions from both of us and how would you actually create that sort of interplay so the first one I'll sort of throw out there and I can put mark on the spot and ask him how this would get built is is this a little sort of outlining of some organizations we got some image you got some text and it sort of maybe lives on a page on the website this is something you would obviously need to create an architecture around mark how would you build something like this so this particular example actually know how it's built so it's built with views and entity cube to order things so nad queue is one of those like modules written by Cortes like in a CA version so you can really rely on that working so this might as well be core and then you this is the one to one thing I would advise is if you're taking over a site is a lot of references and because we have a really good content model in d8 when looks like a view might actually be a reference field so like don't don't assume that it's a view just because it looks like a view on the front ends like a lot of time you need to go into the content type to like actually ensure that it's a view yeah that's a pretty good point but so the power of entities here is definitely going to be a theme for actually building and building all this stuff as well as the ability to sort of choose different kinds of directions to get things done I think one things Drupal has always been possible to do is be able to build things in multiple different ways not they're not necessarily the ones not it's like totally best but there's variations but I think for a site architecture perspective consistency of design is really important you need to a GDQ for this use entity queue for other stuff as well on that same site and you'll end up with a lot a lot more consistent development practice and consistent abilities sort of you know work overall next examples a little a little more tricky this is something that a little screenshot here of a sort of volunteer or matching situation where we have a number of different volunteers that are affiliated with a number of different universities and they may have this sort of like you know workflow process that happens where we're actually you know expressed interest they then get matched with specific you know opportunities and then they can get you know sort of approved if those opportunities should have shown show sort of need around them and then they're gonna get sort of listed here and I think sort of I can turn a start off start off with this one is that I think one of the sort of wins here is really to start to build out some some custom entities that sort of reflect the different things that are going on that's one thing if you haven't built custom entities in Drupal 8 or had a lot of experience with them I think that's a good sort of afternoon learning project grab a session from last Rubicon I'm using custom entities run through it and build a couple of your own because when we have things like a person that maybe has a set of ordinary attributes and we have things like a volunteer opportunity that might have other attributes that being able to like you know have each of them and then have those connect and medians for custom ways ends up being really powerful and one of the great things about the entities is that because it's sort of this consistent data model in Drupal sort of views module in core has the ability to sort of create lists of them based on criteria and that are exposed to them and that's all the pretties for a consistent way so you can build these kind of views where it's like oh we have like you know lists of volunteers that are interested current and past opportunities could be sort of two different lists and those are all things the volunteer roster that could be done in a views context because you're using entities in a consistent way just sort of check it all up and that's something that I think you know that's a pattern you can apply to a lot of stuff in Drupal and when things go beyond sort of what's easy to do in sort of just the UI doing a little bit of custom entity work on top of that really can help you help you really build as sort of sky's the limit kind of complex data models and I would add that da project end up with a lot of custom entities from what I've seen like the date it's 67 if you had to use entity API along with the entity system to really get anything that was useable whereas now that's all in core and then some so entity are usable straight out of the gate and people are using them in creative ways the other thing sort of on that example that I sort of want to share is um and this is going to be different in Drupal 8 point 3 but when you actually have a flow that's going to you know do different transitional states between entities Drupal 8.3 there are sort of a new workflow entities and workflow system in in the core in the core that you can use there's a workflow module today you can use to do a lot of this as well but you basically can define multiple different workflows for each things you can have a volunteer workflow a volunteer organization workflow and they have different transitions that can be just defined with different you know things that happen when those transitions work in this is all pretty hook able and permission of all infrastructure so it's pretty easy to get rid to again sort of what you need but then building something like this to implement a volunteer match system like that ends up being a pretty good plan and with Drupal 8.3 you're able to do all of that really easily and I think that's a big win for a set architecture standpoint because you can reduce a lot of custom code use a core system and really sort of build whatever whatever you want to build as I as a developer I would add if you need this today workbench moderation is the solution to most the eight sites are using and I've been promised an upgrade path to the core system it's like the core system really close is really closely modeled after workbench moderation so if you already have an eighth site and you don't want to wait for 8.3 and you need moderation I would use workbench moderation because chapter three is gonna build an upgrade pack if one doesn't get built by the community lovely to hear next up is a little mobile kind of screenshot this is something that I think you know obviously you're gonna want to do significant planning on a mobile for mobile sites for your each website you build and I think Drupal eight you know sort of was built with a lot of mobile mobile first mobile involved kind of stuff involved I'm wondering mark sort of what kind of tricks do you use to sort of our connect mobile sites like are there some stuff you find in Drupal 8 that's been helpful to sort of our patterns to use to to really try to build stuff good for the cell phones so if you're doing your own like you know using a front-end framework and and doing your own layouts like image handling is really difficult and that's one thing that ships with core is you know the ability to do image variants for your different great points so I think that's that's a huge one the one that shocked me and is a little terrifying is the number of clients that are using the mobile UI to add content update content work on their site so I would say if you're a model maintainer or you're writing custom code don't assume that the admin isn't also going to be used on someone's phones because we've actually seen a lot of that like it's a huge uptick in that because it's fast and it's usable these uh admin on the phone yeah that's up I definitely struggled a little bit with that when I'm on older sites I think sort of planning that alan arkin sir plan is is good you know throwing in those those user stories thinking about that design and I think it is sort of you know building out a really good theme sort of turns into you know hey let's uh you know let's think about how this is done in mobile let's put the architecture up front and not sort of make it a sort of you know extended hacked on version at the end the sort of as first-class sort of kind of citizen this whole thing yeah a lot of Redeemers build something classy as well as just you have a little bit of a starting point there and so anyway that's not might be a good strategy if you're the types of wanted really can make your own theme classy at least gives you like a nice clear starting point two percent to check that out next little little little thing here is just a sort of a sort of mega menu kind of functionality these obviously have gotten a little more popular over the years basically we've got like four different items where if you hover over them there's a number of sub items that a link to something else and this is something that I think I can try to take a stab at this very curious marks marks opinion on it as well is that there's a lot of ways you can kind of build this in in Drupal I think you could probably take a menu system and sort of you know theme it in this kind of way I think one of the things that twig does really well if you sort of can get you know the right the right information sort of in there and a menu you can throw that in and then actually feim feim those item in items pretty easily but another kind of development pattern that I think could also be used that's useful for this and other things are sort of custom block types where you know blocks or dev we're definitely not like the most powerful thing and earlier versions of Drupal but in Drupal 8 blocks are real entities they can are feel the bowl they have like a lot of power to them and you can create custom versions of them to have whatever kind of fields and content you want and so you could create a sort of custom block block type here where you have a picture and a name for like what's on the title you have like a multi-select link box for like you know title and links to go down and then you have a view all link at the bottom and you can create that as a really nice object within within the the Drupal CMS and then sort of exit sort of spit all of that kind of information out to a twig template which could even theme all of it sort of however you want so you can get these really sort of complicated kind of looking designs but still have the flexible in the backend to sort of change edit and improve it as well and that could be I think a potential way to build this kind of this kind of thing which I think I think is pretty good uh that's the last example with guy here before mark sorta runs us through a development plan start your plan for Drupal 8 site it's just uh you know how would I build something like this in Drupal 8 which from sort of an initial perspective I think you know hey we got some text and a button no problem right but I think one of the things that you know the button implies is if we're making a payment you know that's probably gonna like lead us into some ecommerce kind of kind of situation and so I'm wondering maybe mark your from opinions on if you're asked to do e-commerce in Drupal 8 like what what's your thinking around it what kind of architectural decisions you make how would you works have a charge on chapter three do e-commerce for Drupal 8 so for me the first question I ask is like is this the only occurrence of or am I going to have it in a dozen other places throughout the site and if this is the only occurrence the question is do we really want to maintain that technical debt of like our own commerce system or do we want to you know use a SAS provider or some drop-in solution that like doesn't really tightly integrate with Drupal but that's you know that's by design that's to avoid maintaining you know commerce code as part of our Drupal site so I think that's really the first question you should ask is what kind of commerce experience am I expecting acted like is that going to be highly customized and highly integrated with Drupal or is it really kind of stand-alone and you know if it's standalone like can I use a sass product you know like Shopify or something like that you know stripe is really nice as well to you know solve that problem you know I paying somebody else 25 bucks a month instead of me maintain spending far more than that maintaining you know a custom commerce solution yeah I would I would totally agree with that as well I mean I think you can build an e-commerce site in Drupal 8 do in fact that is sort of your deal and you have a lot of content and other management stuff but I think you know getting socked into doing too much of it can definitely be a be a little bit of a at rubs um so yeah so those who have some ideas of some stuff that uh we sort of you know thought were for a cool how do you build it in Drupal 8 I think one of the things that might be helpful is mark obviously does a lot of Drupal 8 architecture and development you know I sort of had him show off a sort of development plan that he uses to actually go sighs our talk us through hey you're trying to produce a site architecture plan what does that look like and how does that work so I'm gonna run through this pretty quick so we have time for questions but what I want to talk about more is why the type of questions we ask and why those need to be asked and and kind of how that ties into Drupal 8 and so for major blades really tied to content and by content I mean it identities and so you really need to be thinking about you know your data structures and how those are named what fields are where and how that you know dictated often by the design and strategy already happened before you're preparing one of these development plans so our development plans we trying to use those as a one-stop shop so that whoever gets handed the site to develop it doesn't have to find any other documents like they can use this one as the jumping-off point for everything so the index shows you know we're talking a lot about data structures and everything else is kind of bolted on to the end you want you want to tell some assumptions about why the website exists you want to find everything else that's been produced up to this point and document that well and so a lot of times this list is much shorter this is what comes out of a chapter three strategy session but you know you might all you might have as machs and that's okay you just want to make sure that they're all linked to from this document you want to collect some goals about the project you know some assumptions about what's coming from the client versus what's being built and you know if you still have open questions after strategy like you know reiterates those here I think the interesting part in terms of DA architecture is you know this implementation plan so this is going through exhaustively describing content types that are being created and how they're being created and how they referenced each other is really what's interesting I think in a DA project so you see the reference fields here those become really powerful and useful and when you're defining custom entities maybe it's not not every entities of full content type and you need to start thinking about smaller entities in your project so each content type gets a full description a whole treatment of all the fields and why they're there and what how those fields are going to be configured this makes it-- building like much easier because you just plow through and then also someone can go in and QA against the death plan to make sure the site building was done properly so like if you spend the time doing in a word dog like this and working together you know maybe a steamer and a back-end dev or working on this together you get a tease out any issues in the design right at the beginning instead of late later on if you're doing an ad hoc so I'm gonna scroll way down relevant to that last example we had so as you can see we got a lot of content types some of them are way more complicated than others the important part is just making sure you capture everything you can see in the design and describe how it's going to be implemented so I think what's more interesting is this idea of slices you know this is like a different approach than you know using something like panels for doing layout and content types and it's really tied around the entity system so this into this description here we kind of explains the chapter 3 approach to a lot of layouts which is you know we're going to do energy construction kiss or you know paragraphs modules becoming more popular as it's becoming more robust and stable it accomplishes the same thing as these two tools and if you want to read a blog post comparing them as the kids got a good one on our blog but what's these slices allow you to do is have reusable chunks and reorder both chunks of content that are their own data structure within the wider piece of content and so these are reusable across different content types and they allow you to have really flexible layouts in this kind of popular I was called a bootstrap style where everything is a long slice everything is a full width and then it has its own mobile layouts as well and so it just as important to get these covered as it is for the parent content types and because these in dubbing the meat of the site and you get a lot of different styles as you can see scrolling down and so as you can see we've get we've got 15 20 pages of just sliced documentation taxonomy end up getting used a lot less heavily as you can see we only have one that's kind of a d6 design pattern that people are moving away from I would say menus are also pretty simple forms as well rolls as you can see it's not a complicated site until you looking at all the different slices and the assumptions behind those slices we're going to have some multilingual considerations but pretty straightforward and so as you're identifying a slide solution or entity solution you need to make sure that multilingual lanius is done well I would say that's a potential trap area so watch it watch out for that front end workflow we're just going to describe which is kind of a standard process and any special theming considerations these work might be departures from what you can see and the comps themselves so that's pretty much it everything else kind of standard boilerplate very little custom development on the site so really the content Isis where all the interesting things and then the slice is within the content type that's where everything gets interesting that's pretty much it for this guy yeah well yeah I know thanks for sharing mark I think that's definitely um you know that's definitely a you know that's sort of cool part of the project I think you know one part from just to sort of thinking through hey we need to actually create a document need to start thinking through sort of how stuff's gonna work I think to bring it sort of back to the restart is that I think a lot of that was let's define our content model let's define our page model and then let's sort of start fillings and let's divide our layout model and start building all that stuff in you can get very far with your plate on that basis all right we have a few minutes to jump into questions here so we'll get there as many as we can the first one was asked while on slide 15 the twig walks slide where mark you'd said don't even really need to think about regions anymore the question is in response to what about panels and she asked this question apprehensively yeah I can I could just give a little a little piece then let mark Alex he's probably got more stuff but I was a big fan of panels in Drupal 6 and 7 and I'm still a big fan of a fan of it in Drupal 8 so with a lot of work going into making it really excellent and I think if you use it consistently you could have a really good site architecture but mark might have different opinions and with you know what I would say is I see there's kind of two camps and Drupal these days it's the you know paragraphs camp which you know you might be using a different tool than paragraphs but one with a different mindset and then there's you know the panel's camp and so what I would say is embrace the tool and learn everything you can about it and see if your team can consistently use it but don't mix and match like don't try to use paragraphs bck and panels on the same project cuz you're just gonna cause yourself paying when you're trying to translate the content if not like throughout the whole build all right next question we're interested in the local development environment mam versus vagrant versus local docker thoughts what kind of local development do you use mark I run Linux I get installed things but that's that's not really attainable for most people I love docker I think docker is the wave of the future and so if you can get a local dev stack running with docker the time you spend learning docker and getting that set up is useful when you're debugging something on a server it's that kind of issue but Drupal VM seems to be the new popular choice around here with devs that don't want to deal with all the issues and learn it themselves yeah I would say I use Cala box for development which is a local docker solution that allows you to sort of spin up you know PHP environments node environments different kind of stuff and integrates einar's a pantheon and could integrate with other platforms pretty easily I think on the Drupal a context like you'll need a little more memory than maybe normal for certain kind of applications and I think a lot of where I see Drupal a development going is sort of being part of a larger ecosystem of other kind of projects and so a sort of a single map solution may not be appropriate so you may need to actually integrate with code and develop on code that's not just PHP and I think having that flexibility for your vironment is good we're dealing x2 bug as well which like may be limited by your tool and so if you can't easily get extra bug up and running like you're gonna be frustrated during Drupal 8 especially be doing back in development yeah for sure all right next question could you clarify custom entity ec k custom code some else all of the above like they just pick an approach and make sure it's consistent throughout the site I mean ezk seems to be the easiest barrier to entry and it's well-maintained yeah cuz you could just expand on what do you see k is for folks who might not be familiar mark so it's in a deconstruction kit the community me convention goes back to content construction kit which is you know the base for all these entities that we have in Drupal 8 and so what that allows you to do is you get a UI for building entities you don't have to write that much custom code if you want to you might get inconsistencies in terms of like revision behavior or multilingual behavior with some of these tools and so that's why we like you to be CK because we've been able to bet that behavior wid ezk and sort of worked a lot of patches to make sure that that works well sounds good hey do you have a good recommendation for themers who are used to writing PHP slash GPL templates to transition to twig forget everything you know about PHP and realize you like are rarely gonna use it anymore unless you want to start writing modules nice alright our next question is do you guys recommend running composer install only during projects installation and commit the vendor directory on version control or build the project dependencies on every build and/or deployment including move to production yeah I can handle this so I definitely think that you should you should as part of your composer workflow you should end up with a build artifact at some point in the process and I think that build artifact is the thing you actually want to run your tests on so I don't think you should do a composer operation in production I think you should do a closer operation before you sort of push it to a test environment and then use that build artifact to that push to a live environment just because composer you know if external services are down or other things are working correctly you could get some inconsistent results and having consistency a build process is important in the development context I've seen it done a few different ways I've seen some folks just use local and run composer or local on their on their system and push that push off the results to to a tube to get it I've seen other folks where they'll use some sort of Constanta Gration solution to do the build steps to do SAS compilation and a new composer I think I'd honestly say that there's I see people do it both ways are successful I don't think there's a sort of great consensus on that yet if you're doing it more useful to have one person in charge like and so you just ping them and slack to install a module for you just so that like there aren't consistencies across environments versions and things like that that happens sometimes it's composer all right next question is are you guys leveraging any kickstart distro such as awk we align yeah I can just break it in for chapter 3 we're not we're not using any distress for da does yeah I would say like the Aqua lightning distribution is pretty great like it does it sort of gears more towards the sort of more of a sort of you know sort of a kickstart kind of thing it's not gonna do like out of the box it isn't like a website still Feli distribution but I think that having some stuff that if you're not familiar with using a lot of Drupal 8 development starting off with something that sort of puts you a little a little higher up the stack is a good idea and I think you know distributions are lot easier to build in Drupal 8 so I could see people having some additional is having some processes like that sort of help speed speed you up but I think you know I would definitely make sure you at leave understand from a starting point what Drupal 8 core gives you and then maybe start clearing out some distributions try speed of development there's definitely some good ones out there like off be lightning there's train squeeze and one or two more questions the next one is a question for max is a full composer based development workflow supported on Pantheon at this point how does this play with Pantheon upstream repo architecture yeah so that's a good question currently sort of well in the pantheon world I think this is true for any site architecture world you want to actually be able to figure out how you're gonna run composer and how that's actually going to use external like up streams and other kind of things to build your site at present for Pantheon we don't have a sort of definitive solution in part because people do it a few different ways I think the way we're sort of probably gonna end up and we'll have more to talk about this at Drupal con in a few weeks is that you can use next our repository like github you can store your composer you know manifest their your SAS files there and then you'll use a continuous integration solution like circle CI to you know take take those take that code do the build step and then push that up to a Pantheon sort of multi dad for dev environment and I think that's sort of that sort of CI solution sort of becomes what Marco's talking about where you have one person who's responsible for doing a lot of that work I think we're for maybe switching to you have one robot responsible for that that could be a good way to go and that just helps to keeps everything sort of sort of rolling along in a consistent manner which i think is sort of a theme of a lot of the architecture stuff we're talking about in general is consistency across the board is really helpful you'll save a lot of time that way we've one more question I think it's a good way to round it out get an answer from both of you and that is what is the most striking thing in Drupal 8 for you I can miss her off with mine I think the most striking thing for me and I mention this a little earlier is that just all the things that you can do without using custom code or just using custom twig code that if I thinking back to like the you know hundreds maybe thousands i'ts I've like been involved in in my in my career you many of those sites could have been built without it without what's very little if any custom code in Drupal 8 and I think that you know the 30 days of having a complicated site Drupal 7 a hundred modules involved to make it all work is sort of is gone that you know what's striking to me is that you can build a really complicated interesting site with using very little custom PHP code just doing configuration and templating and that's been I think that's really awesome for me it's in the design patterns and CMI like we've been hearing about these in the Drupal community now for six seven years and seeing that payoff in terms of the types of controls that are able to be produced and how quickly and easily a skilled DEA developer can write a custom module like really it's nice to see that payoff I mean really you know it takes a while of doing your blade development before you really see that payoff alrighty guys that's all we have time for today thank you so much for watching if you have any questions or feedback please visit our website where you'll find a contact us page and if you'll be in Baltimore for Drupal con you can catch mark at the chapter 3 booth and Matt Chaney at the Pantheon booth I'm sure they would be more than happy to answer any additional d8 questions you all have have a great week everyone
Info
Channel: Pantheon
Views: 7,884
Rating: 4.9024391 out of 5
Keywords: Drupal, Hosting, Development, Wordpress
Id: 4GLkujT3xFU
Channel Id: undefined
Length: 61min 12sec (3672 seconds)
Published: Tue Sep 19 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.