The Taxonomy module makes it easy to display the contents of a category as a page. But how does one display the contents of a category in a page?

Specifically, I need to display the contents of two particular categories (separately, not combined) on the same page.

I believe that I have the option of displaying one category in the content region and the other in a sidebar, or displaying them side-by-side in the content region, using a table. It would be nice to be able to do both of those things, though, so that I have one option to fall back on if the other one proves unfeasible.

Comments

vm’s picture

investigate the views.module

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

orthoducks’s picture

OK, I'm trying it, or trying to, but it is not behaving well.

I installed and enabled Views and Views Administration, gave my account Views Administrative permission, and tried to edit the Front Page view (the only one initially defined). I got an error which said,

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 267187 bytes) in ...\modules\devel\devel.module on line 1334

Views for Drupal 6 is still in alpha, and the comments say it is incomplete. Do you know if it is usable at all at this point? If so, what must I do to make it be nice?

vm’s picture

most times it helps tremendously to put your error in the search bar and use it as a search term.

http://drupal.org/search/node/Fatal+error%3A+Allowed+memory+size

check out the first search result.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

orthoducks’s picture

...that Drupal needed more memory than PHP was allowed to give it. Increase PHP's memory limit...

That is pretty much what I assumed. Notice that the limit is set to 128M! I have no idea how it got set so high, but it's far above the 12M to 24M typically recommended for a Drupal site. And this site is a skeletal prototype, not even working yet.

I'm assuming that memory limit excession is not the problem, only the symptom of the problem, and increasing the limit will merely delay its appearance -- perhaps by hours, perhaps by milliseconds. I'm sorry I did not state that explicitly.

I could try increasing the memory limit to, say, 256M, but that strikes me as a last resort. Even if it works, a site that needs that much memory seems likely to cause performance problems, if not more, when it goes into production.

vm’s picture

A) how are you making the changes to memory ?

B) are sure sure that the changes are physically taking effect by running a phpinfo() and checking ?

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

orthoducks’s picture

I don't understand the question. If you mean changes to the value of memory_limit, I have not made any.

The installation instructions I followed said that memory_limit would initially be set to 8M or 12M, and that for good performance it should be increased to 16M or 24M. I never got around to changing it, but when this problem occurred I discovered that it was set to 128M instead of 8M or 12M. The error message in my original post shows that, and when I looked at the php.ini file I found the same value.

But that is beside the point. Something is wrong, and I don't think it's a shortage of memory. I am seeking advice on how to figure out what the real problem is.

Since my original post I have discovered that (1) rebooting does not help, and (2) the same error occurs if I try to define a new view, when I click the Next button on the first page of the And View procedure.

hpalma’s picture

The views module doesn't seem to be very flexible in terms of layout.
What if i want to list the content items but i want for example to not show the creation date and author ? I can't see how i can use views module for that.

If not, is there any other way ?

joachim’s picture

Change the view type from Nodes to table or list. Then pick the fields you want to show.
I tend to use the List type, and then use CSS to turn the list into whatever I want.

orthoducks’s picture

That would not be feasible in my case, because the user must be able to reclassify an item after it is entered. It's easy to change an item's category, but as far as I know, it is not possible to change an item's content type.

joachim, in another branch of this message tree you suggested Panels. Unfortunately Panels is not available for Drupal 6 at all, not even in alpha, as Views is. I started this project in Drupal 6 on the recommendation of the prime contractor, and I'd prefer to avoid falling back to Drupal 5, as I would have to redo a significant amount of content entry. If I must do so, however, I want to find out now, before I have even more work to redo.

Let's return to my original problem: how to display two or more types of of content, separately, in the content region of the same page? (The page is not one-off -- there are a couple of dozen instances of it, and there will be more over time.)

An alternative would be to display one kind of content in the content region and the other in a sidebar. That would be about equally satisfactory, but displaying the contents of the category in a sidebar seems to me to be about as difficult as displaying the contents of two separate categories in the content region.

I gather that this problem could be solved in any of several ways by doing a little PHP coding to fill in missing pieces of the puzzle. I'm a programmer by profession, and learning to do that type of work is one of my reasons for taking on this project; but everything in Drupal is new to me, and I think I'd be foolish to tackle PHP before I have created at least a functioning prototype site to do the work in. If someone could point me to a snippet of code that solves the problem with only superficial changes, that probably would work well.

joachim’s picture

I'm talking about changing the way the view is displayed, not the type of any nodes.
Views 2 has a different UI which I haven't used, so I can't tell you what to look for.
But basically, in Views 1 you could show your view as a Teaser list, full nodes, List, Table, etc.
This should still be in Views 2!

If you're going to have many pages like this, panels is not the best solution.
I'd go for a custom content type with either CCK Viewfields, or theming the template for that type.

orthoducks’s picture

It looks like Drupal 5 is in my future. Several different experts have suggested different approaches to me, but all of them seem to involve modules that are not yet available for Drupal 6 in a viable form.

Before I take the big step, please help me think about this: are there any plausible solutions to this problem that do not require either significant amounts of PHP coding or modules that are not yet available for Drupal 6? If not, I guess my decision is made for me.

joachim’s picture

Views is still in beta, but I'm certain Views 2 (for D6) has those options.
CCK for D6 I don't know about.

If the views you show on the node can be determined from the node itself by some sort of algorithm, then you can embed the views in your theme template for that content type.
Eg, the node's taxonomy terms or title can be used to get the name of the view. That would require a few lines of PHP code and a bit of delving into the data structures (finding the bit you need in nested arrays, that sort of thing).

joachim’s picture

Is it a one-off page? I suggest Panels, with a node (for your regular page-like content), and two views.
Alternatively, will you need several pages like this? In that case, create a content type, and add a CCK view_field to it, to pick views for each page.