Duplicate Title for Pages: Tagadelic and chunk/<n>

ToddThomson - December 12, 2008 - 17:53
Project:Tagadelic
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I really like your module! However, I have an issue with the following:

Tagadelic blocks provide a title for chunks ( "Tags in Articles", in my case chunk/1 ). There can be a "more tags" link which then brings up all the tags in chunk/1. This works, but the title of the page is "Tags" when it should be "Tags in Articles" ( just as in the block title ). Further, the breadcrumb trail now has "../Tags" with the title underneath also being "Tags". If the breadcrumb trail is followed the page ../tagadelic is reached. The Tagadelic page correctly has the title "Tags", but unfortunately it is a duplicate!

Please let me know if you require any further information.

#1

ToddThomson - December 12, 2008 - 20:07

OK, I've read through the code and will make the changes myself. I don't know the protocol for offering a change, but here is my solution:

1) Make the title dynamic through a callback function ( tagadelic_page_title_callback )
2) For each vocabulary referenced in the dynamic URL parameter ( example: 1, 3, 5 ) the title will be rendered as:
"Tags in Articles, Names, Places

Notes:

1) Keep max of 5 in dynamic group - BUG in code after 7 in group will not be fixed ( implode error ).

Tell me how to submit the patch and I'll make it available.

Cheers, Todd

#2

ToddThomson - December 12, 2008 - 20:53

You can see the following code at: http://www.achilles-software.com/tagadelic/chunk/1,2

Here is the code for the title callback:

/**
* menu callback to render the tagadelic title
*
* Args:
* $vocs: array of vocabulary IDs
*/
function tagadelic_page_title_callback( $vocs ) {

if ( $vocs == NULL ) {
return 'Tags';
}

foreach ( $vocs as $vid ) {
$vocabulary = taxonomy_vocabulary_load( $vid );
$vocs_list .= t( ', @voc_name', array( '@voc_name' => $vocabulary->name ));
}

// remove leading comma!
return "Tags in" . substr( $vocs_list, 1);
}

#3

Bèr Kessels - December 13, 2008 - 20:39

I like your concept.

http://drupal.org/node/323 -- creating patches
and then Iĺl review it in more detail.

#4

ToddThomson - December 14, 2008 - 20:07

I come from a Windows IDE background and continue to use Visual Studio for most of my work. However, to do PHP/Drupal work I use Eclipse PDT. I have installed CVSNT server for source code control (please let me know if this is not a good choice).

Assumptions:

1) I take it that only module developers and maintainers can open the source code for a module from the official CVS repository.
2) I will need to add the tagadelic module to my local CVS repository.

Cheers, Todd

#5

ToddThomson - December 14, 2008 - 22:53

OK.. I found the relevant documentation (drupal and CVS)! ( Drupal docs are SO fragmented )

So for contributing patches:

1) check out the module from cvs.drupal.org. Read only.
2) make changes and test locally
3) move local changes into internal CVS repository.
4) create patch against local file(s) and checked out module from cvs.drupal.org
5) submit patch

I'll give it a shot on Monday!

Cheers, Todd

#6

chrissearle - December 23, 2008 - 13:16

Any luck? Would like to see this come in too.

#7

chrissearle - December 31, 2008 - 11:59

Attached patch against DRUPAL-6--1 (1.40.2.4)

AttachmentSize
menu-callback.patch 1.14 KB

#8

chrissearle - December 31, 2008 - 11:59
Status:active» needs review

#9

Bèr Kessels - December 31, 2008 - 12:12
Priority:critical» normal

http://drupal.org/node/45111

#10

Bèr Kessels - September 15, 2009 - 21:24
Status:needs review» needs work

First: please reroll the patch, it fails.

patching file tagadelic.module
Hunk #2 FAILED at 399.
1 out of 2 hunks FAILED -- saving rejects to file tagadelic.module.rej
ber@yasmine:~/Documenten/TAG_tagadelic/unfuddle/tagadelic-git$

Second: please adhere to Drupal coding guidelines. Mind the spaces after the brackets.

And maybe you are interested in tracking this against my github version and forking/cloning it there? I see in your patch that you use git. http://github.com/berkes/tagadelic

 
 

Drupal is a registered trademark of Dries Buytaert.