0

I am very new to drupal, so I already apologize if I ask something very simplistic...

I have a site where I would like to add a new block to the front page of the website. This block would show the companies newest available training's. I created the sub-pages of the training's. My thought process was that I create the sub-pages, then create a new type of content (with the cck) where I can add the new sub-page node names and their links. I created the new content type with two fields. field_offeringlink and field_offeringtext. Where the the text would be the actuall promotional text and the link directing to the sub-page. After this I wanted to create a Block that I would place on the front page, showing these two fields. I couldn't figure out this part... So how do I make the bloody block show my fields?

OR

If you have a better idea for this whole shannanigan then I am welcome to ideas.

My goal:

Create a dynamic block on the front page, that shows all the latest training's. Under dynamic I mean, that we can add-remove the links from the admin/content menu.

Thanks in advance!

1

You want to create a content type for Training. Then you can add Fields for things like start and end dates, registration deadlines, difficulty ratings, whatever.

Then you want to have a View that exposes a Block, for content type Training. The view shows the 5 (or however many) newest Training nodes that you've created. You can accomplish all this on the first, 'easy' page when you create the new view.

Also, since you used Views, you can then move on to, for instance, showing only Trainings whose registration deadlines have not passed, and so forth.

But basically Views does all the heavy lifting. If you ever find yourself thinking: 'I need to make a page that lists all these nodes,' then what you really need is Views.

1

This definitely sounds like a job for views. I could explain how to do this exactly BUT for your own learning you should install views and go through the documentation also as you will thank me in the long run for not explaining exactly how to do it. You do not need to do it the way you have started doing it already, Views will manage everything you have already tried to accomplish with listing articles.

If you want a shortcut without going through the documentation, click this which will give you a thousand tutorials to do what you want to do.

  • My problem is not that I wish to be lazy, but rather that I am on short time frame. I have less then a day to do this :D – Gergely Csata Feb 26 '12 at 17:40
  • Views is the easiest and quickest way to do this. Basically install views, add a new view, choose which fields from the content type you wish to display, choose how you wish to filter (filter by content type), choose how you wish to sort (sort by content added date) and add a new block view limited by how many items you want to show. Done. It will add the block for you to the blocks page and you place it how you like. Views is extremely simple if you want it to be and extremely powerful and complicated if you want it to be also :) – 7wonders Feb 26 '12 at 18:27

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.