1

I generate articles with the help of VIEWS at front-page. But I want that the second article has a different look. So I want to add div-Tags and additional css-classes to that second article. I have tried to do this with a boolean field but the teaser does not have the possibility to check whether boolean field is true or false. Any idea how I can realize it??

  • So I want to add div-Tags and additional css-classes to that second article that wraps the entire article or a specific part? ex: title? body? post date? – No Sssweat Jul 10 '16 at 9:51
  • I want to add css-classes to the wrapping div-tag and I want to add inside this div-tag specific html-tags ie p-tag, div-tag . – lesley n. Jul 10 '16 at 10:01
  • but where exactly, see this pic the one that wraps the entire 2nd article (red)? or a specific field (blue, green)? – No Sssweat Jul 10 '16 at 10:29
  • You are great! The red one is a div and there I like to change to class. And inside the red div I like to change the html-tags. – lesley n. Jul 10 '16 at 16:12
2

One approach to do this is to use multiple views. One that displays only one node and a second one that displays the others, with an offset of one. Then it's easy to configure those views to use different view modes then. You can do that using Page Manager/Panels, Views attachments or possibly also core blocks.

One thing that can be a challenge to figure out is paging, depends on what you expect to see on the second page exactly. If you have paging, then a different approach might be necessary, for example by changing the view mode of the first view through code, through a preprocess hook or so.

  • I had a different approach in mind, unfortunately there is a bug in D8, so it doesn't work. This answer is always a good alternative. – No Sssweat Jul 13 '16 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.