Okay, I've gone round and round in the handbook and the forum and actual books and I'm coming across all kinds of snippet stuff here and there and moding tpl's etc.

I just want to be able to have the main content in the content column area on the home page, and place a story (maybe others in the future) in the left sidebar. It seems that I can go into blocks and select a number of different module content to go into any number of different regions... but no way am I finding a way to just say place "this" story on the home page in the left sidebar.

This seems like it should be the simplest, no-brainer thing to do in the world. Am I missing something? This seems like it should be about as simple as a click or dropdown selection and that's it. Does something this simple require some coding change, a specialized template, or snippets?

I'm still very new to all this, so I can't help but think that I'm just overlooking the obvious, some selection in some menu item that I've been in a hundred times already and keep missing.

Any help or pointing me in the right direction, greatly appreciated.

Comments

coreyp_1’s picture

Create a custom block and put this snippet in the body:

<?php
  print node_view(node_load(array('nid' => 387)), 1);
?>

Of course, replace 387 with the number of the node you want to display.

Also, make sure that the "PHP code" is the selected input filter type.

- Corey

identity’s picture

Thanks for the info.

So it looks like there is no easy way. At least I don't feel so bad now feeling that I kept missing the simple checkbox or whatever to make this happen. Although I'm amazed that I have to jump through these kinds of hoops to make this happen. Seems like everything is there but no one connected the dots.

Thanks again Corey.

Michelle’s picture

I suspect no one has connected the dots because putting an entire story into the sidebar isn't something normally done. Usually things that go into sidebars are menus and blocks with things like recent node titles and the such. Cramming a whole story in there is kind of unusual.

Michelle

identity’s picture

But this comes back to separation of content and presentation, which I believe has been an important foundation point of Drupal. I understand what you are saying, but this is because of the assumptions that sidebars are narrow strips of real estate and stories are large amounts of text.

Rather, it would be better to think of it as main content and sub or secondary content, or all three for a three column layout. If we are truly simply defining regions of a page, then we shouldn't be locked into what those regions are for and how they are laid out... size, look, etc.

Likewise, a story might simply be used as a small announcement, news item, etc., which may be nothing more than a paragraph.

I'm not knocking the script or the traditional means of looking at it, just trying to question whether the logic is really the best and hopefully help if further evolve.

Thanks for your thoughts though.

Michelle’s picture

There's a big difference between what is available through the UI by default and being locked into a choice. Drupal can put content anywhere you want it. If you want stories in the sidebar, there's ways to do it. It's just not a dropdown menu choice built into core.

Different people use Drupal for so many different things, so many different layouts, that putting every possible choice into the UI isn't very practical. That said, if you would like a UI method for putting a story into the sidebar, write a module that does it and release it. That's how dots get connected. By people who need them connected.

Michelle

identity’s picture

Again, I'm not knocking or attacking what is... but I think there is a natural tendecy to defend it, and that can be dangerous. Progress happens because we continue to question the logic, not defend it.

What I'm suggesting is that this is something that might well eliminate the need for everyone writing countless modules to do one particular thing or another. I'll fully admit that there may be reasons internally that make this more challenging that I may not grasp.

But I also see this as the difference between being for developers and being for users, and that it further supports the foundation of Drupal, rather than spins off from it. Truly a CMS should manage behind the scenes and not impact the presentation. I think it is great that Drupal appears to have a lot built in to help deliver that presentation, but this also seems like an area where it hinders, or starts to dictate.

Imagine the power, forgetting the notions of what a sidebar is... in fact, let's say we have a content section and a secondary content section and we want them side by side on the page.... so imagine how simple and how powerful to have your basic tpl and then be able to say I want stories to appear in the content section and blogs to appear in the secondary content section, with nothing more than a click from within the admin section.

There are these regions that have been setup, and the ease of being able to setup additional regions... truly amazing... I was practically giddy when I saw how easy that was! But then there isn't a way without writing code to say I want this basic content type to appear in this region.

Imagine building a 10 story building, you setup this great scaffolding to go all the way around the building that you use to build the framework for the building. Then the masons come in and start laying the exterior brick. But once the brick gets higher than they can reach, they go get ladders and use those to lay the rest of the brick, even though there is this magnificient scaffolding system right there at their disposal. As someone new to Drupal, this is what it appears to be like in this case.

Again, absolutely not trying to attack or knock, I'm here because I'm very interested in Drupal and want to put it to use. Right now, it helps me to better understand how things work by posing the questions, and I also hope that the questions prompt those who are more familar, who have developed their work arounds already, to possibly take a step back and review the logic again to see whether it still works. I've always believed there is a great power when someone new comes into something and doesn't know better than to question why something works the way it does. Maybe no one else has ever needed this or thought of it, and maybe no one ever will, but I really think that most people, setting aside the thoughts and understanding of "well this is just how it works," would think, wow, that makes a lot of sense and would really save a lot of time and effort... or maybe not. Either way, I think this holds true with some of the comments in other threads from Dries and other core developers in trying to bridge the gap between reality and expectations, capturing what and how people think things should work in relation to how they do work.

Again, I greatly appreciate the time and thoughts from everyone in helping me to better understand how things work.

I don't think this should be a module, to me it seems like basic functioning, but either way, I'm unfortunately in no position yet to be developing any modules, especially being more designer than developer and still trying to grasp the basics.... but someday maybe.

thanks

sepeck’s picture

from the previous few months. Some elements of change need to be introduced through various stages and as a reslt are already being worked on in a more generic direction.

Regions were always posible before 4.7 but 4.7 exposed them in a more accessable way. Elements that were learned in 4.7 and ideas that worked/didn't work will be applied towards 4.8/5.0. So, you might want to subscribe to the development list and begin auditing the conversations to get an idea of where the next version of Drupal is heading.

I think you will like where it is going.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

identity’s picture

That's great to hear.

I totally respect and appreciate the work that goes into developing Drupal, or any project like this. As a former product manager (consumer goods, not software) I know the challenge of meeting the needs of the "consumer" as a whole, to access the needs and suggestions, but also to keep the product in scope and manageable.

Always a challenge to walk the fine line between too broad and too narrow, to make sure the needs of the group are met.

I hope to dig into some of the more detailed conversations, but at the moment haven't quite gotten there yet... still getting the feet wet. But from my previous background, even when I'm looking for the simple 2+2 solution, I can't help but wonder, question, and ponder the bigger picture, and always considering whether the needs are being met.

Thanks for the heads up on the future developments... I have to say that I'm very excited at what I see already and my Drupal knowledge and skills are having a hard time catching up with my ideation!

Identity Developments

Michelle’s picture

to me it seems like basic functioning

That's the problem. What seems like a basic function to you seems like a strange request to me. It's not that I'm right and you're wrong or the other way around; it's just different ideas of what needs to be in core. The problem when anyone says Drupal "should do" something is that there's plenty of other people who think it shouldn't.

What you originally requested was a point and click way of putting a paticular node in the sidebar. So how should the UI for this go? The easiest way I can think of is put a drop down on the edit tab to say what region the node should go to when it's published. Sounds simple enough. But that's just your request. Now User X thinks ABC is basic functionality. So we add a drop down for her. Then User Y wants DEF so another drop down goes in. By the time you get to XYZ, you have a very cluttered edit tab full of things that the average Drupaler isn't going to use.

Instead, Drupal provides a basic UI for common tasks and tools to do the rest. So you want to do something that (from my perspective) is unusual. You have some options:

1) PHP snippit. Fast and easy if there's one already made or you know PHP. Not very elegant.
2) Views. This is the Next Big Thing and can be used for just about any way you want to show your content. Just create a view filtered to one node, set it to show the full nodes, and set it to show in a block. Put the block in your sidebar. No code touching needed.
3) Write (or hire someone to write) a module that will add that dropdown to the edit tab for you. Probably not the best choice in this case but useful if you're going to have a lot of nodes going into different regions.

So my point was never about what Drupal should or shouldn't do or how we look at regions or any of that. It's just that core is best kept to common functionality. The things that most Drupalers need. Otherwise it just gets more complex for everyone. If you need something that core doesn't do, there's always a way to do it.

Michelle

identity’s picture

Thanks for the additional thoughts. I totally agree that it can't be everything for everyone. I think it comes down to finding the most basic functionality and serving it up... even my initial question should be broken down to non-specifics... it isn't about putting a story in the left sidebar, it should be about putting a node in a region. Again I see this as further separation of content and presentation. I could be completely wrong, but I think something like this would be one of those, "how did we ever do without this before?" type things... but maybe not. Perhaps, we'll find out depending on what the new functionality turns out to be in the next versions.

Either way, I agree though, there are no wrong or rights, it is just an evolution of an idea, growing and adapting.

Identity Developments

venkat-rk’s picture

Another way to do this is using the views module. But that will make you jump through a few more hoops;-)

identity’s picture

Thanks, I'll have to take a look at it. I haven't quite gotten that far yet. I have heard a lot of good things about it and recommendation that it find its way into core. My initial thought is that it is a heavy duty tool for what should be a simple operation... but that is really only based on impressions so I can't really say until I try it of course.

Thanks.

eaton’s picture

Views is a heavy duty tool because it does many, many, many different things. It allows you to put teasers for random nodes in a sidebar block, or generate RSS feeds to all articles by a particular person, or create page listings of the prices of books reviewed by contributors to your site, and so on.

If you want a single focused tool that just allows you to put the contents of/teaser for a node into a sidebar block, then you're just doing something that has not, up to this point, been needed by someone else. Or, at least, someone else who wasn't able to whip up a little bit of PHP code to do it themselves.

It's not a bad request, but -- as an earlier poster noted -- there is a nearly infinite list of 'simple things' that various folks have wanted or needed. Generally, the Drupal developers lean towards providing useful APIs for other modules to use, rather than cramming every possible feature into the core's 'default' UI.

--
Eaton's blog | VotingAPI discussion

--
Eaton — Partner at Autogram

identity’s picture

Absolutely. One of the things I've been most impressed is the lean, mean core. While this is really my first spin with CMS, so many scripts, especially open source, get so bloated trying to provide for every possible use, which is admirable, unless that every solution has been incorporated into the core, meaning that everyone is weighted down with these choices, whether they choose to use them or not.

Rather, the real leaders provide a way to serve every solution by making sure that addons can be created to work with the system and provide the added functionality. I think Drupal's module and theme system is a beautiful example of that... maybe even setting the standards.

However, when working on the big picture, sometimes the simplest, most basic things fall through the cracks... preparing a great picnic and then realizing that no one packed the plates. Maybe this isn't that case, but that is certainly the question in my mind... is this a basic, core functionality?

Just pondering the question :)

eaton’s picture

I do think, by the way, that very simple module that allows a user to create a new block that includes a specific node would probably be very valuable. I'm not sure if it's core material, but if I get a chance in the next couple of weeks I will try to whip it up. :-)

--
Eaton's blog | VotingAPI discussion

--
Eaton — Partner at Autogram

Robert Castelo’s picture

If you're using Drupal 4.6 you can do this easily using Sidecontent module:

http://drupal.org/project/sidecontent

I haven't had time to update the module to 4.7 yet, but will do so soon.

Cortext Communications
Drupal Themes & Modules

------------------------------------------
Drupal Specialists: Consulting, Development & Training

Robert Castelo, CTO
Code Positive
London, United Kingdom
----

identity’s picture

Thanks, I am using 4.7 though... since I am just starting I figured it would be better to start with the most current version... by the time I get it all figured out, I'll probably have to upgrade to 7 or 8 as it is!

But I will keep my eyes open and check out your module when it is updated.

Identity Developments

Robert Castelo’s picture

Side Content module now available for 4.7

http://drupal.org/project/sidecontent

Cortext Communications
Drupal Themes & Modules

------------------------------------------
Drupal Specialists: Consulting, Development & Training

Robert Castelo, CTO
Code Positive
London, United Kingdom
----

Joat’s picture

If not, write the text directly into a block. The easiest way I can imagine, and no php snippets needed. Just go to admin section, choose blocks and add new block. You can position it and define pages where it can be seen etc.
I'm speaking from 4.6 experience only, don't if this is still the case with 4.7.

DL’s picture

Create a block based on a taxonomy block>taxonomy block(e.g. news), then configure taxonomy block, set the number of nodes to display and teaser length, then set parent as news, then tick block and place it the proper place.

identity’s picture

Thanks for the additional ideas. I will keep them in mind and may have to play. For now, as things seem to go, I've drifted away from the original plans, but this will no doubt eventually be useful and needed sooner or later either way.

Identity Developments