LATEST NEWS BLOCK BY DRUPAL VIEWS, CCK AND QUICK TABS

This tutorial shows you how to create a latest news block as tabs and a latest news page by using Drupal Views, CCK and Quick tabs modules. Drupal quick tabs module can be used to create any type of content as tabs.

Watch Part One here http://www.youtube.com/watch?v=KjJn4bvsCIs

Watch Part Two here http://www.youtube.com/watch?v=xoJbPiJcgvY&feature=related

Watch Part Three here http://www.youtube.com/watch?v=8IYdNJ5heJY&feature=related

Tutorials:

Comments

Hey Ciril

First of all thank you very much. It was a amazing tutorial and it started to work in my first attempt. Can you help me in one thing?
I wanted to create boxes in right sidebar block with different colours. I have tried panels and views but no help. If you could help it would be great.

Cheers

Keep making tutorials they are very helpful mate.

Hi Anonymous Friend,

I hope you are asking for blocks with different colors or styles, am I right?

If so it's easy... mmmmm if you have basic drupal, HTML and CSS knowledge.

[1] Let's start it by creating a new block in Admin>Sitebuilding>block

[2] After creating the block drag and drop it in any region you want the block to appear.

NOTE: I recommend yo to create a custom region to create custom blocks styles, so that the styles you apply affect only the blocks in that region.

[3] Let's imagine that you have created a block in a region already exist, such as Right Side Bar, if so follow the steps below.

       [1] Go to drupal site directory sites>all>themes

       [2] Check whether any file named block.tpl.php and any other with similar names, such as block-navigation.tpl.php. (NOTE: it varies depends on themes.)

       [3] Open your theme's .info file and check the names of regions available, and here in this exmple we need region Right Sidebar, so see this code regions[right] = Right sidebar. The region name in the bracket I have colored it in orange is the one we need.

      [4] Copy the file block.tpl.php and rename it to your region name, here in this example right-block.tpl.php and open this file and edit it as you wish you can use html div tags and CSS classes for styling.

      [5] Save the file and go to your site, then go to Admin>Site configuration>performance and clear the cache.

Now you can see the blocks in the region right is with your new style. You can create each and every block like this by creating individual tpl.php files. You can even create views template files same way.

 

Again I think it's a good idea to create a custom region always. I know what you gonna ask now

Well how to create a custom regions?

It's simple (may be)

[1] Open your page.tpl.php file and serch for the area you want to add a new region.

TIP: If you use firebug or web developer toolbar on firefox you can see examin the code and region names and CSS class names. So that it would be easy for you to find the region where you want to create new one. (You can use coda, dreamweaver, or free text editor COMODO EDIT).

[2] After deciding the area you want to write the code just write one like this, it's a simple one.

<div id="featured">
<?php if ($featured) echo $featured; ?>
</div>

[3] Now open your theme's .info file and add your new region like this;

regions[featured] = Featured slider

That's it. (and of course you can write more complicated PHP for region such as if there is nothing in the region it won't display anything.) Ah don't forget to clear the cache from admin panel.

 

This example is to show you an anther one, this time is for search box at the top just like on my site.

<?php if ($search_box){ ?>


<div class="search_right">
       

<?php  print $search_box; ?>
</div>


<?php } ?>
it will show only if there is a content in the region or else nothin will display.

I know it's bit hard to understand, may be I have to write an another tutorial about this.

 

Hope you gor the idea.

I agree with the entire comment above. Thanks for sharing nice information with us. i like your post and all you share with us is up todate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.

Espresso Maker | Electric Scooters. | Stand Mixers | Slow Cooker

Yeah man its way too much detailed but I liked your patience. Thanks a lot again. Basically I am an SEO and digital marketer just started to learn drupal and so I am a newbie to drupal core but will perfect it sooner or later, Actually was thinking if you could make a tutorial on panels as there are no detailed tutorials for panels and even for some jquery stuff oops sorry to be greedy.

Cheers
Sandeep

Thank you very very much, 先生 !!! Finally I understood Views, I had too much problems with them. Great work. Thank you. Natasha (Russia)

I am glad to hear that I could help you to understand the use of views atleast a bit. Once you got the idea of views you will find it so easy to create lot's of advanced features for your projects. it is an awesome module with rich functionalities.

Best wishes for your Drupal development.

I love this tut so much,thats so great! MANY thanks <3

Hi,man,your video is very helpful,thanks you very much.
And also,we are waiting for the new videos.

Thanks you !

Great tutorial!

I'm using views 3, drupal 7 and I worked through the tutorial fine.

The only issue I'm having is that when I place the "latest news" block in the content section of my page, the title is unformatted and is just plain text.

If I place the block in the sidebar the title is formatted correctly. The title is also unformatted in any of the banner sections.

Any advice on this? Thanks again!

I enabled quick tabs styles mod and everything was fine.

The block title was still unformatted (but that has to do with my block/theme/css), but I disabled the block title and then styled my quicktabs and the results are perfect.

Thanks again for the great tutorial, it was really my first experience with views. I didn't use taxonomy and instead setup 2 block views/quicktabs, 1 for "latest news" which contains nodes of content type "latest news" sorted by date posted, and the other "recently updated" which contains nodes of all content types, displaying the most recently updated nodes by the date updated. I also created a page for latest news where users can see a paged view of all the latest news.

Thanks again!

Great tutorial!

I'm using views 3, drupal 7 and was still able to follow this tutorial.

Everything worked great...however, the block title does not show up when I place the latest news block into the content section. If I place the block into the left side it works fine.

Any advice/suggestions?

Thanks!

I have a lot of product-pages that all have a QT-block in the content-bottom. Now I populate the two tabs with plain text that i fill in by adding new blocks and then populating the qt-block with these two new blocks. So when adding a product i have to first create the product, then create the two blocks, then create a qt-block with the two new blocks as tabs, then activate the new QT-block for only the product-page I just created. This takes a lot of time, and is not user friendly. Moving Pods Moving Containers