Something very, very fundamental is eluding me after weeks of searching, reading and experimenting. So, a hint please.

All content items are nodes in a database, which have paths.

Content can be categorised with taxonomy terms.

Content can be 'gathered together' with Views, which also have paths.

The layout of a site can be determined using regions, blocks, panels and mini-panels.

Blocks and mini-panels don't have paths.

Panels can be further divided into columns.

Links can be set up with paths to content - either directly to nodes or to views.

Clicking on a link displays the content in a 'content area'.

If all above is correct, what I can't work out - and this seems absolutely basic - is how to click on a link so that content is displayed where it's required.

For example, a top horizontal menu has links to different content.

You want to click on the first menu item so that content appears in the left column, say.

You want to click on the second menu item so that different content appears in the left column, say.

You want to click on the third menu item so that content appears in the right-hand column of a panel in a different region of the page, say.

In other words, how do you 'place' content?

I've even defined a 'forestry' taxonomy, but still can't see the wood for the trees.

Regards.

Comments

ludo1960’s picture

You are flummoxed because you are asking too many questions! Take a break then hit us with one question at a time....:-)

cog.rusty’s picture

There are ways. I can't answer directly the "third menu" question because I don't use panels, but in a similar situation I would add a block on the region that I wanted, which would appear conditionally.

Although technically blocks don't have paths, they have visibility settings to make them appear when you are on a path, which is the same as if they had paths.

nevets’s picture

As you noted, "Clicking on a link displays the content in a 'content area'.". This is the main content and its placement on the page is determined by page.tpl.php and where $content is printed. This includes panel pages, the panels end up where $content is printed, the difference is panels allows you collect pieces of information/content and have it show as a single page. Other content ends up in blocks which are placed in regions. The regions are part of the theme and their placement is determined by page.tpl.php. You control which blocks show in which regions using the blocks admin page and as cog.rusty pointed out you can control their visibility.

So, given a single page.tpl.php the main content ($content) always appears in the same relative place.

cog.rusty’s picture

...to finish nevet's sentence, if you want panels in a different place on that page path, you need to create a page template for that page path which places the content area elsewhere.

Steve Barnes’s picture

Thank you 'cog.rusty'. I understand this point. Do you know the panels module well? If so, is it possible to dynamically change content in whichever panel area you choose?

cog.rusty’s picture

I have no working knowledge of panels.

Steve Barnes’s picture

Apologies. You'd already said you don't use panels.

Steve Barnes’s picture

Thank you 'nevets'. Can I then conclude that it's not possible to determine where content goes? Although you can change page.tpl.php to have it appear in a different area, it will always then be in that new area. Is that right?

Maybe it's possible to have multiple versions of page.tpl.php so that $content can be displayed in different places.

As regards blocks, controlling their visibility is likely to mean, in this case, some conditional php code - not ideal for non-technical site-builders.

I think I'll have to abandon blocks, which just seem too inflexible (l read also that it's to be an optional module in Drupal 7) and instead have a single page area that is divided up using panels. I still haven't worked out how to dynamically change content in panels (content panes?) so there's much more playing around to do.

If there really is no solution to being able to change content in different areas of a site by clicking on links, then I may be terminally flummoxed.

summit’s picture

Nice writeup.
Panels are divided in panes, and in the panes you can show whatever you like: a view, a block, a custom peace of code, a view-display etc...
Conditionally, may be there is a ajax module which is usable for panels, or you can look into panels context..it's quite difficult, but beautiful concept. I do not use it right now, but have been experimenting with it in the past.

greetings, Martijn

Steve Barnes’s picture

Maybe that's a wood up ahead, just peeping through those trees . . .

The Context module looks like the answer, combined with Views and Panels.

Blimey, learning Drupal is one mighty long obstacle course.

Thank you, guides.

ludo1960’s picture

Good luck my son, I've tried the context module, documentation ain't very good, I found it "tree like" and fear the obstacles barring your transcendence to woodiness are somewhat optimistic.

cog.rusty’s picture

One idea is to start small. Pick a tree. Make a treehouse. Have a look from there.

ludo1960’s picture

One could also reflect on the true meaning of woodiness see here for more detail http://www.youtube.com/watch?v=-gwXJsWHupg

nevets’s picture

Two issues

Moving $content, you can have variations of page.tpl.php, core supports some by default, you can add support for others if needed.

As for panels, panels can have dynamic content in page panels take arguments. So if one pane held a view that also to the same argument(s) (or a subset) the content can reflect the argument.

In general your question is so wide/vague though it is hard to provide specific guidance. Letting people understand what you want to achieve make get you more focused answers.

summit’s picture

hi,

I was not referring to the context module, but USING context within panels.
You can use context and argument using panels/views so the argument-handling in the view is reflected in the panels, it is great flexibility!

greetings,
Martijn

Steve Barnes’s picture

The question I've been struggling with is this: how do you get the content you want where you want it?

So, yes, it's wide because it seems a fundamental requirement for any website.

I wasn't really looking for specific guidance, so the question isn't vague so much as general.

The above question has two parts: how do you 'get hold' of the content you want to display, and how do you get it diplayed where you want it.

And the answers seem to be:

Use Views to provide a path to the content. And use Views in combination with panels and context and arguments (plus maybe the Context module) to display it.

Nowhere on drupal.org is this explained, so maybe the woods-and-trees problem is not mine alone.

Unless I'm barking up the wrong tree, or have got the wrong end of the stick.

Tell me it ain't so, Joe.

Meawhile, thanks again for the help. I'm off now to spend some quality time with panels, views and contexts.

I may be some months.

mcfilms’s picture

Can I just mention that you seem to jump over "Regions" and "Blocks"? This is the root-level, built-in way to direct content to where you want it to display on the page. You can expand on this capability by creating a "block View" (using Views) and assigning that to a region. You can make these blocks only appear on certain pages and you can control the order they stack.

Maybe if you had a specific example of what you would like to do, people could offer better guidance.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

summit’s picture

Hi,
And what about the display suite: http://drupal.org/project/ds
The newest way to bring content where you want it?

greetings,
Martijn

Steve Barnes’s picture

That could be it. Inching closer . . .

Steve Barnes’s picture

OK, specifically . . .

A primary link. I want to click on it and see content appear in a particular 'place'.

Let's say, specifically, the left sidebar.

(The next, specifically, could be the left region of a panel - but let's not go there yet.)

ludo1960’s picture

I claim the cookie!! You want the http://drupal.org/project/menu_block module for that particular task!

Steve Barnes’s picture

Nope. Not when you want a second link to place different content in the sidebar. The problem is blocks don't have paths.

cog.rusty’s picture

True, they don't but they have visibility settings for paths. You can make any number of blocks appear or disappear on any regions you want for a given path.

Steve Barnes’s picture

Well, that sound promising. I'm not sure exactly how you do that but I'll spend some time trying to find out.

esllou’s picture

Steve raises a far more fundamental question than the one he asks directly.

Free cookie for anyone who can tell me what it is...

mcfilms’s picture

I guess that it is that Drupal does not have an out-of-the-box way to have menu choices update content update in one region while leaving the rest of the page alone. Of course I'd argue that you don't want this anyway. It would prevent much of your content from getting correctly indexed by the search engines.

I'll take chocolate chip.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

esllou’s picture

well my thoughts were more directed towards the fact that *STILL* after 6, going on 7, full versions, drupal is basically "flummoxing" for anyone coming to it for the first time. I've been here for three years so this is not a noob's point of view...it's actually a grizzled old veteran's point of view. It's just accepted that D has a steep learning curve and it's almost something of a initiation that all drupalers have to go through.

sometimes, it's good to throw out basic conventions and approach things from a new angle.

Steve Barnes’s picture

Or a cookie, if you'd prefer, 'esllou'.

Yep, it's still a nightmare. Nobody knows how to put what you want where you want it. Or if they do, it's literally inexplicable.

esllou’s picture

I don't want this to thread to turn into one that beats up on Drupal, but D8 needs to be approached from a noob point of view...not one which beats out the usual "that's the way we do it" mantra over and over again.

I asked for a theme to be converted from 6.x to 7.x a few weeks back and the developer came back with this:


I'm not converting to 7.x. Sorry but look at this: http://drupal.org/node/254940. What do I do? Go through all that mess and then do the same for 8.x when another set of whims takes their fancy?

I've persevered with D and it's a great CMS but it's in danger of disappearing up its own cookie chute. I feel your pain mate but I would advise you to stick around. Ultimately it IS worth it...it just shouldn't be this painful.

WorldFallz’s picture

You can't have it both ways-- if you want drupal development to be agile enough to fix what doesn't work or redesign the user experience then you get major version changes like the ones linked above. If you want to limit version changes, then you end up with essentially the same code from one version to the next. You can both lock down changes and make major improvements at the same time. Drupal's philosophy has always been to sacrifice backward compatibility for forward improvement. See On backward compatibility: the drop is always moving.

There have been major improvements from D5 to D6 and again from D6 to D7, and I anticipate many more in the D7 to D8 development cycle. Maybe not a much as people would like, but significant none the less. Fact is, there just aren't enough core developers to work on everything they'd like to.

esllou’s picture

yeah, I know the arguments. I've read them a thousand times. It's part of the "mantra" I mentioned. Often the choice isn't between A and B but its implementation.

Steve Barnes’s picture

Believe me, I will stick with it. I'll crack it eventually because Drupal is worth it, but there's something mysterious about why there are no guidelines - not just at drupal.org but anywhere on the web - about how to place content.

When I do crack it, I'm going to sit down and write about 250 words that answer the question I keep coming back to: how do you get the content you want where you want it?

Sorry if a couple of posts have been a bit negative but finding this particluar needle in the Drupal haystack could drive me mad. I hope not before v7 comes out. Apparently, it will be much more "intuitive". Now that'll be worth a whole box of cookies.

mcfilms’s picture

I found the O'Reily book "Using Drupal" to be very useful when I was getting up to speed. And I still say you are missing something very fundamental with Drupal's blocks and regions for controlling which content shows up where on what pages.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

Steve Barnes’s picture

I may yet have to go down that route, ideally some Kindle offering. There's got to be something conceptual that will click any time now (I hope).

Blocks and regions? See the post below ("There's certainly something") re paths. Short of some conditional php scripting, I can't see how you can use links to change the content of blocks.

summit’s picture

How about the homebox development: http://drupal.org/node/794728.
greetings, Martijn

Anonymous’s picture

It seems to me that you might be trying to hook too much together.

Content MIGHT BE 'gathered together' with Views, which also MIGHT have paths. I'd say that content is gathered together using regions, blocks, panel, mini-panels and/or views... but you don't necessarily need those elements to view content.

The layout of a site can be determined using regions, blocks, panels AND/OR mini-panels -- but probably not all at once.

Clicking on a link displays the content of the page that's been assigned to the URL. 'Content area' is entirely relative.

So the question I'm wondering is, in your scenario -- Say that I click on the third menu item, which you want to display specific content in the right column. What do you want to appear in the left column?

(And yes, I have more to add, but I want to be sure that I understand what you are trying to do before diving in deeper -- or bushwacking more trees to maintain your forest metaphor :) )

Steve Barnes’s picture

There's certainly something conceptual that I don't get.

As I understand it (hah! understand), 'content' is displayed via the variable $content in the content area, and content area is a region.

Content will have a path, so when I click on a link that has the path of some content, that content will then be displayed in the content area.

But it's not always the content area that I want to change. I may want to leave the content area as it is and change the information that is in another area of the page, such as a block somewhere, or a pane in a panel, or a menu that is in yet another region.

The problem I'm coming up against over and over (and which seems to be what I don't get) is that only content has a path. Blocks don't. Regions don't. Panels do, as they're content, but panes in panels don't.

The answer to your question is: I'd probably want everything else to stay the same, most of the time.

I get the point (I think) that a path is the address of a page. What I'm trying to do - which seems fundamental to any website - is to change some part, or parts, of it while leaving the rest alone.

adaddinsane’s picture

I have skimmed the questions and answers on this thread. I think I understood your requirement from the outset - except I found it to be a very odd request. As in: "Is there any website in the universe that does this?"

Do you really want to have a set of clickable links (apparently menu items, in which case they are fixed links) at the top of the page that change the content in specific parts of the page? I just don't see how this could be good - why not just go to another page that shows the content?

You seem to imply that this is something that all websites do but I don't know a single one that uses menu links to change different areas of the display, which leads me to the conclusion: we (or maybe just me) actually don't know what you want (or, possibly, you don't really know what you're asking for).

Is there a website with the functionality you're trying to duplicate? If so, can you provide a link?

Steve Turnbull, D8 developer

Like Science Fiction, Fantasy or Steampunk stories? Check out https://taupress.com/book-list

Steve Barnes’s picture

OK, I'll be specific. I've avoided that so far as I wanted to understand the general concepts behind what I'm trying to do.

A local newspaper has different editions for different areas of a town. The different editions contain different stories.

Translating this to a website, links at the top of the page might be Area 1, Area 2 etc.

In a left-hand column (say 20% page width), there would be a list of links to stories. When you click on a link in this left-hand column, the particular story would appear in an area on the right (say 80% page width).

As you click on the links at the top (Area 1, Area 2 etc), the menu of links in the left-hand column changes to reflect a different set of stories.

So, the answer to your question "Do you really want to have a set of clickable links (apparently menu items, in which case they are fixed links) at the top of the page that change the content in specific parts of the page?" is yes.

Websites?

See Newspapers on Drupal (http://groups.drupal.org/node/5100) > Media sites using Drupal.

I chose the first one on the list www.24heures.ch.

Click on 'ACTU', then on 'VAUD & REGIONS'.

nevets’s picture

That is possible and there are different ways to achieve that.

I am going to use http://moneypit.com to demonstrate. If you under, 'Home Spaces', 'Repair and Improve' or 'Ideas and Solutions' you select one of the items from the drop down menu (say Home Space > Bathrooms) in the left column there is a menu of items related to the current section (Bathrooms for example), in some cases it can even be empty.

This example happens to be taxonomy based, 'Home Spaces', etc are hierarchical vocabularies, the drop downs show level 1 terms, and the left hand menu shows level 2 terms (which are optional). As the user selects from the main navigation ('Home Spaces', etc, your 'Area 1', 'Area 2') the site 'tracks' what the user has selected and displays not only the left hand menu based on this but other blocks on the right side.

The key is to have a well defined site structure, one where 'Area 1', 'Area 2' have a relationship to the menu and content such that you can programmaticly select/display the appropriate menu, list in a block, etc.

Steve Barnes’s picture

Yes, exactly, and that would be a requirement that applies to lots of sites. A top menu changing a menu in a left sidebar, which, in turn, changes main content and/or other 'regions', 'panes', 'blocks' etc.

This is a perfect example. I have a feeling, though, that when you say "you can programmaticly select/display the appropriate menu, list in a block, etc", you may be talking about custom coding, scripting and the like. I'd quite like to be able to do this through Drupal core or modules.

nevets’s picture

It depends on how you define your site structure, for example if you define it with taxonomy terms, core plus the context module may get you there (or close). The other part of the picture are views/panel page that are context area. The starting point is a clear site structure and how you want elements to reflect it.

One of the pluses for Drupal is you can organize a site in any number of ways, but I suspect this at least in part leads to your frustration, there are no "cookbooks" I am aware of that say if you want your site organized this way, do this so ...

adaddinsane’s picture

My work here is done.

:-)

Steve Turnbull, D8 developer

Like Science Fiction, Fantasy or Steampunk stories? Check out https://taupress.com/book-list

Anonymous’s picture

It is possible to do what you want, and as with anything Drupal, there is more than one way it can be done. The example you provided seems to be simpler than what you've described; the content in left column changes but the right two columns stay pretty much the same.

On that site, the main content area appears to be the left column. It seems that views placed in panels on a panel page *and* node content populate that area, and that is what is triggered by the URL.

It also seems that the right two columns are populated by two sets of panels in two regions. I would probably feed the content into the two right columns using blocks. Block configuration and maybe some views configuration could be used to determine on which blocks appear on which pages (URLs).

I'm sure that there are more sophisticated ways to do it, but that's where I would start.

As I said, there's always more than one way to do something in Drupal. Hopefully other folks will jump in with other ideas.

Steve Barnes’s picture

The site suggested above by 'nevets' (http://moneypit.com) is a good example - though he may be talking more about an approach to coding rather than using a UI.

But I still feel it's a general question rather than a solution to a specific requirement - and that's how, using Drupal core and/or modules, do you change content in different 'areas' of the screen by clicking on links.

I feel like I'm back at the beginnining of the breadcrumb trail that I carefully laid down when I first entered this wood.

cog.rusty’s picture

You wouldn't want a block to have its own URL path. That would mean that you wouldn't be able to pick and choose which blocks appear on some pages (for example in all forum pages). Now you can.

Steve Barnes’s picture

Ideally, I'd want to use a number of blocks (menu blocks in this case), making only one of them visible when I click on a primary menu item.

You say (above):

"Although technically blocks don't have paths, they have visibility settings to make them appear when you are on a path, which is the same as if they had paths."

The visibility options in configuration are:

Show on every page except the listed pages.
Show on only the listed pages.
Show if the following PHP code returns TRUE (PHP-mode, experts only).

Do you mean that I use the path in the menu item for "a listed page"?

Steve Barnes’s picture

Ahhhh. That works. That's one (confusing) tree less. Thank you. Now for changing content in panel regions.

Steve Barnes’s picture

Except I now have the gloomy thought that this could entail listing what might end up being lots and lots of page paths for each block. Back to panels, maybe.

cog.rusty’s picture

There will be lots if you include/exclude pages without "explaining" your logic to Drupal.

If the logic of the block visibility is the same logic by which you have organized your pages into some kind of "site sections", a PHP snippet with a few lines will be enough.

Myself I didn't even know what PHP code looks like when I started imitating some snippets to do that, but that was no challenge. The challenge is the conceptual plan.

Steve Barnes’s picture

Point taken. It's not that I'm averse to hacking php code, but I'm trying to set up a site for people who wouldn't be able to do that. I'm now looking at the Context module, which offers more visibility criteria.

It has a taxonomy terms option, which looks promising, but nothing's working so far.

Steve Barnes’s picture

No, it looks like blocks aren't going to work. There's seems to be no way to determine visibility, short of a long list of paths. The Context module, using taxonomy terms, is not a runner either, as you can't tag menus and blocks with vocabulary terms.

Well, that's a shame. Next up, a long haul with panels.

cog.rusty’s picture

See an example snippet for block visibility settings
http://drupal.org/node/136029

You have roamed into "advanced" territory and failure on first attempt will be something common. It is possible to go through all the options and conclude that "nothing works", but just think "if others do it then it can be done".

adaddinsane’s picture

One thing to bear in mind is that each Panel page can have "variants", and there are selection criteria to decide which variant to use. It can be URL based, or node based, or taxonomy based, whatever.

I recently started work on a site (actually a whole set of sites) for a UK university which serves up page content based on selected taxonomy items - and those are displayed in a menu on the left using a view. But also there is a slightly different page layout for the home page of the section. Variants is the way to go.

I get the impression Drupal is somehow worse for people who do have a clue - because you immediately want to jump to the hard stuff and end up smashing your head against a brick wall because you don't know enough. (Or maybe that's just me.)

Steve Turnbull, D8 developer

Like Science Fiction, Fantasy or Steampunk stories? Check out https://taupress.com/book-list

Steve Barnes’s picture

. . . visibility.

Maybe all the questions I have about 'placing' content are really questions of visibility. To display this or that, here or there, by setting conditions (and ideally, for me, conditions related to taxonomy terms) on their visibility.

adaddinsane’s picture

Well, that's what Panels is about and each variant can show a different selection of content based on taxonomy, or whatever.

You can feed the contexts you create for a panel page through to any Views that collect content for the page.

Whether it's a good enough match I can't know but it seems a reasonable starting point.

Steve Turnbull, D8 developer

Like Science Fiction, Fantasy or Steampunk stories? Check out https://taupress.com/book-list

mcfilms’s picture

You can organize your content to include virtual urls that you specify like so:
remodeling/bathroom/sinks
And then you can make a block show up (or not show) on ALL remodeling urls by doing this:

remodeling/*

Another thing: You can move where the content shows up on the page by writing custom page.tpl.php files. Using these page overrides you can direct content to new areas.

I'm going to take a break from this thread now. I don't know if my info is helping. Also, in response to a request for a specific example, the site you showed STILL had the main content in the content area. Content in the side bars changed, but that was accomplished using the information presented here already.

Barring a very specific example of what you are trying to accomplish, notes on what you've tried so far, and a list of what doesn't work, I don' think I would be much help.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

kaakuu’s picture

Refreshing discussions.

Steve Barnes’s picture

I think it's time for me to cogitate on these matters. Many thanks to all and apologies if I have not acknowledged or responded to individual suggestions. I'll need to work through them to get a better grasp of their significance.

Many threads in the Drupal forum contain requests along the lines of "what exactly are you trying to do" or "please give a specific example". It often seems that there are no 'woods', just lots of individual 'trees'.

What I've been trying to understand is how Drupal works, so that when I want to do something I'll be able to say: yes, that means I need to look at this to get that, or this means I'll need to work with panels rather than blocks, or views, say, in this way rather than that.

The wall I keep hitting stands between content and display. I think I now know how to 'get hold' of content, but every time I try to display it somewhere or other, or change it in a particular area, I come up against this wall. The answer is just the other side of it, out of sight.

That 250-word "How To" guide is still struggling for an intro. But, hopefully, it won't be too long before a new thread appears with the title "Not at all flummoxed".

Meanwhile, à tout à l'heure‎, j'espère (see you later, I hope).