5

I don't think I understand Drupal too well yet. I have an article. In the theme I chose it has the various blocks. How do I put an article on a given block area of a theme?

I see the modules I can assign to a block in a specific region, but I have things articles I want to put in the block. I don't need who's online, recent comments, etc.

6

If you want to put a node, where in your case it will be a node from an article content type, you can use the node as block module.

You also have other module options, including:

These modules allow you to add your nodes inside a block. Afterwards, you can configure which block to show in which region on the block administration page. For example if you want to hide the 'who is online block' simply set the region for the block to none and it will not show up any more.

| improve this answer | |
  • 1
    Why would it be so hard to add an article to a block? Is it because it is more of a themeing issue, that is hard coding the article link into a region? – johnny Nov 16 '13 at 18:18
  • 1
    @johnny It's not what would be considered 'core' functionality (for example I think I've done it maybe once or twice ever out of dozens of Drupal sites I've built). That's where Drupal shines - all it takes to get that functionality is to install a module. It's an extra step, but one that you'll get used to quickly. – Clive Nov 16 '13 at 18:30
  • 1
    @johnny And to counter Clive, all sites are different. I routinely need to do things like this on the sites we build for clients. – mpdonadio Nov 16 '13 at 18:46
  • @clive Can you show me a demo site that doesn't have something like what I'm asking? I am having trouble visualizing it. – johnny Nov 16 '13 at 19:16
  • I generally prefer to use Bean to create content as blocks. The module is similar to the core Node module, but is tailored towards building and maintaining blocks instead of pages. Usually if I want to display a node in a block, I'll use Views to display and add additional logic (such as displaying the most recent node of type article, for example). – thirdender Nov 19 '13 at 20:52
9

I don't know if there is any shortcut to put the article into Block, but usually I use Views for that. After installing Views Module

  1. create new Views and select content of type Article
  2. Check on Create a Block and Continue and Edit
  3. In Fields, Select the fields you want to display eg: Article Title, Description, etc.
  4. Use the Filter to filter results.

If you want to display only the latest Article, then use Sort by Post Date Desc and in Pager settings display max items to 1 with No Pagination option.

Go to Structure->Blocks and select your theme and you can enable/disable what blocks you want to display and where. If you are unsure about the regions in theme then click Demonstrate Block Regions

This looks one heck of a task, but playing around Views would make you more comfortable with Drupal.

| improve this answer | |
0

If you decide to dive into the "panels module way" of layouting your pages, then you will find that it comes closer to your way of thinking. Traditionaly, blocks are not for "putting the article content into my theme". Blocks are for the fluff around your content. (like e.g. Who is online) But the "panels approach" will replace the "classic block way of doing things" in your drupal. Panels will instead support your approach of "put the article's content here -- like I would place a block."

| improve this answer | |

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.