Trying to create a page to group similar information, need help

rstoeber - October 16, 2005 - 00:02

I've been experimenting with Drupal for a few days and generally have had very little trouble. I've installed a couple of different themes and picked one I like. I have added several modules with no problem and all seems good.

The thing I'm stuck on right now is something conceptual and I can't get around it. Maybe I've just been staring at the computer too long and the answer is too obvious. But I hope someone can point me in the right direction while I go out to get a few beers.

I'm making a site focused on wine, micro brewed beers, and food. What I want to do is have those three main categories (wine, beer, food) as the 'primary' navigation buttons in the header of the page. Clicking on the 'Wine' button, for example, should bring up a page with an introductory paragraph, links to our wine resources, and below that the most recent wine forum messages and wine stories. In other words, that page needs some static (or semi-static) content on the top and the other (user provided) content below that.

I don't know why this is so hard for me, but I can't figure it out. I can get static pages, and pages with only the wine forum messages. But I can't seem to combine the static and variable content on the same page.

I'm not even sure I'm making sense anymore - this should be easy.

Can anyone give me a kick in the right direction?

Sticky?

Geary - October 16, 2005 - 02:18

One easy way to do this is to turn on "sticky at top of lists" for the "static" content that you want to keep at the top of each page. Would that do the trick?

I typed an answer that took

venkat-rk - October 16, 2005 - 04:38

I typed an answer that took me more than an hour and a half to write, but I lost it because I tried to locate the drupal PHP snippets page on the same page I typed the reply for you.

This is not the first time this is happening and I wish drupal.org would retain the information entered into the form even before preview is clicked.

I don't know when I will find time again to do this. I was thinking of posting my reply as a handbook page...

Quick reply: Doing it

venkat-rk - October 16, 2005 - 05:07

Quick reply: Doing it dynamically using drupal's taxonomy system

1.) Think of the vocabulary name as something internal that your site visitors do not need to see or doesn't have to be displayed on the site (http://drupal.org/node/32914). I suggest something like 'Site Sections' and then you add terms such as Wine, Food and Beer. This automatically gives you a home page for Wine, Food and Beer

2.) Create the vocabulary and terms by going to administer>>categories. While adding the terms, add a term description to get the introductory paragraph you want for each category. Also note down the term id's for all your categories. This is normally of the form taxonomy/term/edit/1, but you just need taxonomy/term/1

3.) Enable the path module (adminster>>modules>>save configuration)

4.) Go to administer>>url aliases and click on the 'add alias' tab. Enter taxonomy/term/1 in the system url text field and simply 'wine' (without the quotes) in the url alias field and click on 'Create new alias'. Repeat this process for your other terms (categories)

5.) Go to administer>>themes>>configure>>theme_name and ensure that the checkbox for Primary and Secondary links is checked under 'Toggle Display'

5.) Go to administer>>themes>>configure>>global settings and, depending on the theme you have chosen, either enter your category names (wine, food and beer) in text boxes or as follows under Menu Settings>>Primary links:

<a href="wine" class="active">Wine</a>|
<a href="food" class="active">Food</a>|
<a href="beer" class="active">Beer</a>|

Click on save configuration. You should now be able to see your categories (terms) as the primary navigation and clicking on them should take you to the pages with the intro paragraphs.

When you create a story or forum posting, just select the term and that posting will come under the intro paragraph for that term's home page. You should also manually add the alias (this field is under the node's title field) to ensure that your story or posting comes under the right page. Your alias should be of the form 'wine/best wines'(without the quotes)

If you want to avoid manually adding aliases for every node you create, you must install the pathauto module and configure the story and forum patterns to automatically generate the url aliases for you.

intro paragraphs

cel4145 - October 16, 2005 - 05:50

"Click on save configuration. You should now be able to see your categories (terms) as the primary navigation and clicking on them should take you to the pages with the intro paragraphs."

This sounded great, so I just tried this in 4.6, and the category description did not display. Is this a 4.6 or 4.7 feature?

You are right. Now, where on

venkat-rk - October 16, 2005 - 12:29

You are right. Now, where on earth did I pick that up from? Thanks for pointing out my mistake.

rstoeber, sorry for misdirecting you.

That leaves a few options:

1.) post the intro paragraphs as a sticky to the taxonomy term page, but remove the sticky title
2.) Use a combination of book pages and dynamic php snippets as outlined here (http://drupal.org/node/23730#comment-54744)
3.) Use the taxonomy assoc module to make the term page a node so that you can add the intro paragraphs (at least, this is how it sounds from the module description)
4.) Use a simple page to add the intro paragraphs and then use the php snippets to get the most recent stories and forum postings

You would still need to use the taxonomy module to set up the categories.

cel4145, thanks once again for pointing out my error. Well, at least I learned something in trying to help a fellow drupal user:-)

where it came from

cel4145 - October 16, 2005 - 19:13

I think it might have been available briefly in an earlier version. Too bad it's not an admin option. Definitely would be a good way to create a taxonomy-based display.

Well, I almost got the

venkat-rk - October 17, 2005 - 13:24

Well, I almost got the answer with the taxonomy_assoc module, but it doesn't seem to work when the term is aliased:
http://drupal.org/node/34347

 
 

Drupal is a registered trademark of Dries Buytaert.