Weight by content type (bulk node change)

shanep - February 10, 2009 - 17:47
Project:Weight
Version:5.x-1.3
Component:Documentation
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Is there a way currently to change the weight of all nodes in a content type? I have about 450 items in one content type and maybe 100 or so in another that I want all to be the same weight. Is there a way to bulk change them or do I have to change them all manually on the content page?

This could be a feature request if it isn't available. Thanks in advance!

Shane

#1

NancyDru - February 10, 2009 - 21:03
Status:active» won't fix

You can do it with a simple query in PhpMyAdmin. I don't see that there is enough need to add this to the module; if others disagree, I will revisit the issue.

#2

shanep - February 23, 2009 - 22:11

Ahh brilliant.. Do you know which table in the database I would need to update to do a bulk change? That would definitely solve a lot of individual changes. Many thanks!

Shane

#3

NancyDru - February 24, 2009 - 04:35

It would be the "node" table. Set the "sticky" column to -100 to be unweighted, non-sticky.

#4

shanep - February 25, 2009 - 15:16

Thank you much! I found a few tutorials on the web that were really helpful for new SQL users. Here's the SQL code I ended up using for a mass change of a content type:

UPDATE `my_database_name`.`node` SET `sticky` = '-40' WHERE `node`.`type` = 'your_content_type' LIMIT 300;

#5

NancyDru - February 25, 2009 - 15:55

That may be more complicated than is needed, but it should work.

I did just realize that I may be able to include a "Default weight" setting for enabling a content type. I will take a look. Oh, I can only do this in the 6.x version because of differences between D5 and D6.

#6

NancyDru - February 25, 2009 - 19:06
Status:won't fix» fixed

Committed to 6.x only.

#7

System Message - March 11, 2009 - 19:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.