Possible to display prev/next navigation below file attachments tables?

Zach Harkey - April 21, 2006 - 20:00
Project:Category
Version:HEAD
Component:Category_display
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

If I attach files to a category node (using the upload module), the attachments table is displayed after the prev/next navigation. This feels wrong since the attachments are part of the actual category node. Is there a way to change this?

#1

Jaza - April 27, 2006 - 12:09

The category_display navigation elements get appended to the node's body through the same mechanism as the upload file table: that is, through the 'view' operation in hook_nodeapi().

Drupal calls all hooks in alphabetical order of module name, which is why the category stuff appears before the upload stuff. The only way to change this is by changing the 'weight' field for a module in the 'system' table of your site's database (currently no interface for this - you have to do it manually using a DB tool, such as phpMyAdmin).

So if you give the upload module a lighter weight than category (and then emptying your cache would be a good idea), this should fix the problem. I can't think of any other way to fix it, I'm afraid.

#2

Jaza - April 27, 2006 - 12:21

Hey, I just thought of one other approach you could take: you could try overriding the default behaviour at the theme level. You could create a mytheme_category_view() function which returns an empty string '' all the time, thus removing the category stuff from its usual position on a node page (and removing it altogether, for that matter).

You could then create another function, called something like mytheme_category_view_custom(), which is exactly the same as the original theme_category_view() function. Then, create a node-category_cat.tpl.php and node-category_cont.tpl.php file, and call theme('category_view_custom', $node) at the spot of your choosing in these templates (or, even better, assign a variable with the output of this function, using a custom mytheme_node() function in your template.php file).

I haven't actually tried any of this, but if it works, it would let you fix the problem without touching your database, and without hacking Drupal core or the category module. The custom changes would only be in your theme (which is where most custom changes belong).

#3

Jaza - April 27, 2006 - 12:26

Oops - meant node-category-cat.tpl.php and node-category-cont.tpl.php in my post above.

#4

JirkaRybka - May 20, 2009 - 22:00
Status:active» closed

3 years old support request in unlikely to attract any attention... Also it was 4.7.x. Closing.

 
 

Drupal is a registered trademark of Dries Buytaert.