I 12 – Views Field Markup

Hello and Welcome. In the session we’re going to modify the view we created last time. A block view we created last time. I just shortened the name from upcoming training courses to just courses to make it easy. And this is what we’re going to change, we’re going to add some modification. This is the title and this is the date. Let us modify some styling to it. We are modifying the title. Click on it. Now we can create a label, but we don’t want a label. Style setting, we’re going to add some sort of a tag. Let us add a tag. H3, the header 3 tag. and in the no result behaviour, if there is no title we can make it hide if it is empty. Apply to this display. Have a look, see a H3 title tag is now applied to this view. Now, let’s change the course date. In course date we can also create a date here, date and time or something like that. There is another way another is rewrite result, so let’s do that. Override the output of this field with custom field, let’s say date and time. Date and time. And the interesting thing here is we can add a replacement pattern, we can do any of this pattern we can add here. So this is the course date, we can add like that CTRL C to copy, CTRL V to paste, so it will be showing date and time and the actual date and time. Apply that, so date and time, than the date and time will show. Apply this. See how it looks, it look like date and time and the actual time so it’s the same in other places. Say for example, if you just want only the date, you can change that here and change to course date where is the rewrite result, over here and the pattern. The replacement pattern is if we just want the date we can click on that. This is only for the date, this is for the date and time. Okay, cancel out of that. So what we did is we just added a tag here and rewrite this with a pattern. This is our course block view, so we need to put that somewhere. Let’s save that first, we have unsaved changes, let’s save that. So that’s being saved. Now, where we are going to put it? Let’s go to our site – this is our home page. Let’s put a block, say, in between this one. to put our block about useful link in the front on the homepage you have to go to structure and block layout, it is sidebar second, it is sidebar second place block. So the block we created is training courses, block courses so place block. So it is asking for more configuration so we’re going to put – in a particular place we’re going to put on the pages the front page, this one, f.r.o.n.t so there’s the code for that to put on the front page I think that’s all we need. Let’s put on the front page, save block. So announcement, useful link and training of the course. Let’s have a look at that. So that is our upcoming courses, one, two and three this is the pagination. So this is the training courses now and if you click on more it’ll go to the actual page itself the view we created. Okay. For example, now we want to the pages this to come in between there, so just a matter of moving it over there. So go to structure block layout and there is this sidebar second, you just move it up there. and save. It is now moved up. You can also move up by using this this edit view, configure block. So we moved the block to here. So you can put that block anywhere, anyway you like. Just a matter of adjusting the block layout section. In this session we learned about how to modify the block view and put it in a place we want. Thank you.

Posts Tagged with…

Write a Comment

Your email address will not be published. Required fields are marked *