Show language of node in queue view

fletchgqc - May 29, 2008 - 12:37
Project:Nodequeue
Version:6.x-2.4
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

First of all, I downloaded the new dev version of nodequeue 6 and I've run a few tests of what I want to do and it's working perfectly (just the basic node queue module).

Also it works nicely with content translation (I suppose by default) - in that you can add lots of different language nodes to the queue and the page that renders the queue will only show the nodes that are in the language you are viewing. Great!

Anyway... what would be really nice is that when you view the queue in the admin interface, if there was a column to show the language of each node. I've got seven languages and I need to keep tabs on having enough nodes in the queue from each language!

Actually what would be the best would be a language filter to show only nodes from a certain language on the queue view screen... but I think that might be a bit much to ask. Such a filter should actually be a default feature of most of the admin screens in drupal actually (e.g. menus) so it's not really your department. But I reckon at least the column should be easy to stick in?

#1

merlinofchaos - May 29, 2008 - 15:56

Hmm. Now that language is built into Drupal, this is going to take a little thinking. We can do language as a column, at least; if translation is on you probably will want to know that information, so it's a good start. I don't think it's the finish, though, but I'm not sure where the finish IS.

Ideally we'd want language queues to be basically totally separated; right now, you're kind of losing the max queue size ability, I think, as well as having automatic handling of translated nodes when a node is added to a queue. It's a difficult problem though. Will ponder it.

#2

fletchgqc - May 30, 2008 - 03:06

I wouldn't separate the queues - I like the idea of handling all the languages in one queue. One "Front page feature articles" queue, not 5 queues like "Front page feature articles EN" and "Front page feature articles DE" etc etc.

Note that, as stated above, the standard node queue functions will only pull the nodes corresponding to the current language out anyway. So you don't need to add anything to these functions.

Some way to easily see how many nodes are in the queue from each language would be good. Like some kind of count - an integer printed somewhere. I think in 90% of cases people would want the same amount of nodes in the queue in each language.

I wonder whether you could add a feature that adding a node to a queue will only bump out a node which has the same language - not a node from another language! Starts to make me think about separate queues... but I just don't like separate queues because with 7 languages you need silly case statements in your templates to grab the queue with the correct ID for this language.

I also considered the automatic handling of translated nodes, as you mentioned... but there are lots of tricky cases. What if a node isn't translated into one of your languages? Then you add the node to the queue, all the translations are added, except one language is missing. So then you need to add a different node for that languge (if you want every language to have the same amount of nodes in the queue). But then when you add that node, all the translations of it get added in the other languages as well!

I suppose it wouldn't be to hard to have a box you can optionally tick when you add a node: "add all translations of this node as well" / "remove all translations of this node as well". That would be nice and fairly easy to handle.

OK I'm thinking as I type and all this has led me to this idea: You can create a type of queue where you specify the maximum number of nodes of each language that are allowed in the queue. A node will only bump out nodes of the same language. All you have to figure out is how to treat "No language" nodes. Hmm.... I quite like that idea.

#3

nonsie - June 2, 2008 - 16:40

Just my 2 cents:
I think it wouldn't make sense to have different queues for different languages however I would like to specify the minimum count of nodes per language in a queue. I'd treat nodes with language and language neutral nodes the same way.

#4

leafish_paul - May 6, 2009 - 14:11

After running into some issues with translations + nodequeue (#433930: Nodequeue / Flag translations not displaying in a view), I have resorted to using nodequeue treating translated nodes as separate entries. In my case, node titles are NOT translated (only body text and some other CCK fields), so the resulting nodequeue admin pages are a somewhat unmanageable.

So, a +1 for me for a straight-forward "Language" column on nodequeue admin pages, if i18n module enabled. This could perhaps be done with hook_form_alter? I will take a look when I have some more time.

#5

leafish_paul - May 8, 2009 - 17:41

Rough and ready patch to hack this into nodequeue.module.

AttachmentSize
nodeque_lang.patch 1.18 KB

#6

ezra-g - May 12, 2009 - 16:13
Status:active» needs work

Thanks for submitting this patch. I agree with the intention of this patch but it needs work:

CVS keeps track of code changes so we don't need your username inside the code.

Also, the query you wrote could be integrated in the main query that retrieves the information on the queue administration page rather than adding a separate query.

#7

ezra-g - May 12, 2009 - 16:14

Also, please use the cvs diff -up option when submitting patches. For more, see http://drupal.org/patch/create/ . Thanks!

#8

ezra-g - May 12, 2009 - 16:38

Sorry about the mail spam, but I wanted to add that this doesn't solve the problem of showing nodes in the current user's language, so the language column will always show the language of the original node and the title continues to be untranslated.

Also, for this to be a long term solution, it's probably best rolled as part of #234004: Drag and drop node ordering which I expect to land by early June.

#9

yingtho - November 3, 2009 - 07:33
Version:6.x-2.x-dev» 6.x-2.4
Status:needs work» needs review

I have created the patch so it shows the language as the first column. Please see enclosed patch file.

AttachmentSize
nodequeue_lang.patch 2.75 KB

#10

ezra-g - November 26, 2009 - 01:28

Thanks for this patch.

A few points of feedback from a code review:

A) It looks like you're removing $form[$node->nid]['#node'] = (array) $node;, but this data is useful to functions that theme this form.

B) Both the node title and node language link to the node. Is it necessary to have links in both places? this seems confusing.

C) Nodequeue can either treat all translations of a certain node as the same, and effectively recognize these nodes as being in the queue, or not make this connection and allow administrators to manually add translations to a queue. In the first case, does it still seem useful to list the language?

 
 

Drupal is a registered trademark of Dries Buytaert.