Display Suite Views displays

Video loading...

  • 0:01
    Display Suite for Drupal 7 Display Suite Views Displays
  • 0:03
    with Kristof De Jaeger
  • 0:04
    On this part I'm going to talk about views displays.
  • 0:08
    So views displays is also available through the Extras module,
  • 0:13
    and if you go to the Extras menu, go to Other, and right at the bottom
  • 0:17
    there is a check box called Views displays.
  • 0:20
    And if it's enabled, then at your Display Suite menu item
  • 0:26
    there will be a new submenu item called Views displays.
  • 0:29
    So that's where we will go.
  • 0:32
    So first off, this is a view I've created of articles.
  • 0:38
    It has a header, its has a footer, two results of article pages,
  • 0:45
    and also an exposed filter.
  • 0:47
    So we can just go and filter as we like.
  • 0:53
    So now we're going to use Display Suite to takeover
  • 0:55
    the views template files.
  • 0:57
    So that's basically what we're doing with displays.
  • 1:00
    We takeover the views tpl file, so we can do fun stuff with it.
  • 1:05
    So what you have to do is go to Views Displays, and as you can see,
  • 1:09
    there is nothing selected here.
  • 1:12
    There's a select box where you can choose
  • 1:15
    which one you want to create.
  • 1:17
    So let's just take Articles_2 and Page.
  • 1:22
    That was the view we're looking at.
  • 1:23
    Let's add it.
  • 1:25
    Internally, there's an entity created, ds.views,
  • 1:30
    which will make it possible to use Field view
  • 1:36
    item to manage the layout on it.
  • 1:38
    As you can see now right now there's only a title.
  • 1:42
    You first really need to select a-- let's see, what will we be using,
  • 1:49
    let's use the two column stack-- you need to select a layout first.
  • 1:53
    And then after that, what you will see is we have the layout,
  • 1:56
    and then we have a couple of more fields.
  • 1:58
    Those fields are actually the variables that you would see
  • 2:01
    if you would open a views tpl file.
  • 2:03
    It's not available through the user interface.
  • 2:05
    So it's really cool.
  • 2:07
    You can, let's say, let's put the expose filters on the right.
  • 2:12
    Let's put the views contents on the left.
  • 2:16
    Views footer, well let's put the views footer
  • 2:19
    in the header, which sounds strange but you can do fun stuff with this.
  • 2:24
    So let's save it.
  • 2:28
    And let's reload, and there you go.
  • 2:31
    As you can see, I have to play a bit with my CSS, of course.
  • 2:36
    I could do that and do something else of course.
  • 2:41
    I could go to the Manage Display of this note, let's change
  • 2:49
    the image to thumbnail, and it should look a bit better right now.
  • 2:56
    So there you go.
  • 2:57
    This is a views template.
  • 2:59
    It's been taking over my Display Suite,
  • 3:01
    and the results inside are also [INAUDIBLE] Display Suite.
  • 3:05
    It's a whole package in one, of course.
  • 3:08
    So that's one part of views displays that's available.
  • 3:12
    A second part is a really crazy one in my opinion, but it works.
  • 3:16
    So let me go to the View, and if you have seen this screen [INAUDIBLE]
  • 3:20
    before if you're using Display Suite,
  • 3:22
    and you know that there is a Display suite row plug-in for entities,
  • 3:25
    but these are also a Display suite fields plug-in.
  • 3:28
    So let me enable that.
  • 3:33
    And let's add some fields as well.
  • 3:37
    So that's a contents body.
  • 3:45
    I do not want a label.
  • 3:48
    Formatter can be default.
  • 3:50
    Can be default.
  • 3:51
    That's OK.
  • 3:52
    Let's also look at contents image.
  • 4:01
    I do not want a thumbnail.
  • 4:05
    There you go.
  • 4:05
    So I'm just now configuring the view so that it actually will work.
  • 4:10
    As you can see in the preview, I'm using the Display Suite fields
  • 4:14
    plug-in for results of my view.
  • 4:17
    It tells me that I have to go to views displays of Display Suite
  • 4:20
    again.
  • 4:21
    So first of all, let's save.
  • 4:23
    I will go back to my article list, and you get the same message
  • 4:27
    over here for my results.
  • 4:28
    So let's go over here, and in the Select box
  • 4:32
    here, you will see that there's a new option
  • 4:34
    for Articles 2 page fields.
  • 4:36
    So let's add it.
  • 4:39
    And let's manage the layout of it.
  • 4:42
    And first of all, again, you have to create
  • 4:45
    or you have to set the title.
  • 4:51
    And there you go.
  • 4:53
    So these are the fields that we have just put in and just enabled
  • 4:57
    in views, and we can now drag and drop them around into regions here.
  • 5:03
    So let's see.
  • 5:05
    Let's save it.
  • 5:08
    So the image is on the left and the content is on the right.
  • 5:12
    Do I have my view open?
  • 5:13
    Nope.
  • 5:15
    Let me go to my view Articles 2.
  • 5:19
    And there you go.
  • 5:22
    This is View Displays fields through the Display Suite fields.
  • 5:25
    So it might be a bit confusing.
  • 5:27
    It's also not a feature that's going to be used a lot, I think.
  • 5:31
    The views template file in general will take over.
  • 5:34
    It's probably a bit more interesting.
  • 5:38
    On fields, it's a little less used.
  • 5:41
    But it works, and it's fun to play around with.
  • 5:45
    So that was Views Displays.
  • 5:47
    See you another screencast.
  • 5:48
    Thank you for watching.
Loading ...

Display Suite Views Displays

Loading...

In this lesson we cover another "extra" of Display Suite, Views Displays. This basically allows you to take over a view template file and use Display Suite to layout your views.

Additional resources: