Drupal 8 Display Modes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I'm gonna poke around on a Drupal 8 site this is with using alpha 9 so still definitely some some buggy things and stuff like that going on in here but a good look at where Drupal 8 is currently as of recording this and what I wanted to look at was under structure there's this new menu item now called display modes and I'm familiar with view modes in Drupal 7 although I haven't played with them a lot beyond the basic usage of them but this is really interesting because there's view modes and forum modes and I got a little confused we're trying to figure out what that actually meant and so to back up one second here let's just talk about view mode in Drupal 7 so if I look at this list of view modes in Drupal 8 you can see under content I have these different view modes it's sort of different contexts that you see your content in and so I have you know full content and teaser probably the ones you're most familiar with and like if I look at a at a Drupal 7 site so this is a Drupal 7 site article content type if I go to manage display here you can see I have these view modes that are listed here and and in Drupal 7 you can just basically toggle on and off which ones you want to use but it's essentially the same thing as what we have here in Drupal 8 it's just that this list is configurable whereas in Drupal 7 you kind of get that list on your content type and that's kind of that but with this in Drupal 8 I can actually edit the view modes that I have available so I can change the name of this so full content doesn't make sense to me or to my users or something like that I can always edit and just change the name of it you can't really do anything else but but at least you know I could change the name of that if it's going to make more sense to people and you can also add your own so I get add my own custom view modes here which if you're familiar with things like dis sweet or if you've used custom view modes but here I can sort of add my own so I make something up one contents in a sidebar for whatever so I can just you know yeah add my own thing in here and then I can use that on my my content types and then when it comes to displaying I can do something special with that and make different fields appear say appears in that context versus the full content context and you can do this for I have a couple different things so we're familiar with them in content from Drupal 7 but we can we have ones that are made for us for user compact use your account so full user account compact like showing to the side or something no but great like different context when you might be looking at user information and then taxonomy comments custom blocks so this is pretty cool because you get to define these display modes if you want to and then be able to use them in different ways so like okay so if I added this here I would think that when I'm configuring my content type that I would be able to use this so let's see if that's true if I go in to structure content types and let's just go into my article here and manage display because again the view modes as part of the display of your whatever it is content user and stuff like that so I'm going to manage the display default teas are these the ones that are done by default and again I have this custom display settings but you see now this custom one I created is available if I wanted to add that and so if I can check that off then that ends up up here and so you know by default I want all this to show but let's say on the sidebar you know I don't want any of this other stuff to show up so that's cool and then of course there's you know teaser stuff like that so eat so that's cool and then of course you have to do something with that use that view mode in some way you can use V modes in views module which is kind of confusing because we're using the word view and a whole lot right now but let me if I go and do we'll see I haven't played with views in Drupal 8 this will be interesting so let me just go into something like front page which is just a list of content on the site so we can see yes things are a little buggy still so that's missing this style plug-in but if I had for an unformatted list you know you could have I could show different things but here I can see like the the row style option like if I'm sure if I was showing content like um Drupal 7 you could choose like content and then did you want to show the full note or the teaser and here yeah again this custom one I created is here so if I added a new View mode and you know picked the styling for how I wanted that to look and I can you know limit the fields right like if I instead of picking teaser it has different fields on it in my content type sidebar has different fields yet again that are showing so I can customize which fields show this this is neat um that you can just do this through the interface now without needing an external module cool yeah so that works um neat the other big thing though I wanted to look at here because this this definitely confused me a little bit when I first started looking at this so display modes view modes this is something we're familiar with from Drupal 7 but now they have this thing called forum modes and I got really a little on this one so for modes when you go in there there's just this only user I can't there's no other entity types in here or anything I don't know if that's going to get at it or not but and then there's just this register form mode so I'm assuming that view mode is like for display like the final display and so for mode is like how your form how the input form looks versus the final product that you're displaying to like your end-users and so if we go and look at structure in the content types again right and so if I go in here in manage fields for my article content type here you can see so I have manage fields tab which were used to in rupal seven and manage display but now there's this new manage form display alright so they can Drupal seven see we have manage fields manage display just those two and in Drupal seven on manage fields you pick your field the field type is stored in the database and then you pick your widget which is the input form element like what does it look like for someone to upload an image or type in the body text what does the form look essentially is what widgets are and so in Drupal 8 what they've done is they've actually split this out because if you look at my manage fields now I'm only selecting my field type like that's just this first part right just these first three columns are here along with the operations there so all this is is selecting your field type and then form display tab is where you deal with your widgets and like the order right because this is again like how do you determine when someone's filling in the form what order are the fields showing in alright in Drupal 7 you just do it on this manage fields tab move them into the right order so they've sort of basically they've split this out to give you a little I think a clearer sense of where things are split up and more fine-grained control over them it makes sense because we were in Drupal 7 we were doing two things on that manage fields and now they've broken it into the three components of a field like I've always when teaching you know it's like you have the field the field itself how is it stored in the database then you have the widget which is how someone inputs that data on a form and then you have the display which is what does it look like when it gets spit out you know in a web page so basically they've just taken the three concepts of a form broken them into individual tabs now which is pretty cool so now managing form displays new thing I got initially when I was looking at this a little bit ago I got a little confused just because the word display is used so many times there's display modes there's form display manage display like it's not managed I don't know final display content display whatever so - took me a little while - yeah and figure it out but that this is sort of what's going on my understanding of what's going on here and then here's all my widget II stuff and I can define how the form should look which is of course different than how the final display looks you can change the order of the fields and everything like that so that's pretty cool and then I'm guessing like you know really this is just they split the tab out into a new tab it's not really doing anything this this display mode stuff like said in forum modes right now I can't do anything about the forum I don't know what mode you would have for filling out the form that there would be different modes for that but for content but I'm sure we can think of those things and I'm sure that that as time goes on people will extend what's going on here in core and so I'm assuming like with the user stuff like I guess with a registration form or something if I go into account settings mmm I'm just gonna play with this for a second here right because this is where you control you know the user forum essentially so you can add field so again this is just the field type so if I wanted to add you know some other field here I don't know phone number and actually there is a phone number that's not enabled a phone number field I'm just going to pick text just so I can do this real quickly you we all know what I'm saying but there is a new phone number field I think field settings yep do those things cool let's just do all this I just want to get back to my tabs all right so I have this and now I can manage form display so the widget user name and password visible cool so I can okay which is visible what's not visible how right again how do you format the picture how do I format the phone number right so that's you know widget II things that's cool ah and they see he down here on the form I have custom display settings typically you would see that under the manage display tab right again this view modes thing so these are the view modes for the end display but for users you can actually manage the form display we didn't have this for the content type and I can say that I want the registration form to look different than the form if they're already like in the site I'm thinking is where they're going with this so like we would have all of this information say like on the main user forum on the site but when I was registering maybe I don't I don't want people to have to put all this stuff in and so I can hide this stuff on the maybe I can hide it yes I can hide this stuff on the registration form and just determine what should show there like that so if I go to my go to my accounts so if I this is display so these would be view modes edit profile is the form mode but this is because this is like all of the things because I'm right like here's my phone number thing I said in here but if I log out and go to register if I allow registration let me oops allow anybody to register here real quick and we'll just see what this looks like I'm really curious now yeah okay let me log out and then create a new account right and then these rate I just have the username email address and the picture I don't have all of that other stuff but I could have all the other other stuff on the new account registration if I wanted nice so anyway that's a little bit of a look at the nudists lay mode settings that you can play with in Drupal 8 it's nice because in Drupal 7 you needed contributed module to be able to sort of modify those view modes and and create your own and do that kind of a stuff so now it's built into Drupal core and now they have this new form mode thing which I'm really curious about I mean right now we just have this one with the user registration but I'm curious to see how that gets expanded to be able to really create custom forms for you know I don't know different different forms for different people doing different things on the site with the same thing I don't know it'll be interesting to see so anyway Drupal 8 it's coming get in there Thanks
Info
Channel: Drupalize.Me
Views: 14,463
Rating: 4.6721311 out of 5
Keywords: Installing and Touring D8, Display Modes, Drupal 8
Id: 3D_llkTX6II
Channel Id: undefined
Length: 13min 56sec (836 seconds)
Published: Tue Mar 04 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.