We had a project where this was needed, so we decided to offer a patch for the functionality.

The patch adds a field in the configuration form where a user can specify a pattern for the urls of the tag links similar to what you use in pathauto. The option is only available if the token module is enabled, since term tokens are offered for use in the pattern.

An example of a pattern might be resources/[term:tid]

Comments

MGParisi’s picture

I will keep this open and see if there is a demand for it, but I want to remind everyone that tagclouds is a stripped down version light weight tag cloud solution where as the tagadelic includes a wider feature set.

Also Tagclouds supports path auto.

P.S. I may release a 2.0 version for more community submitted features.

MGParisi’s picture

Shy should I include this when path auto does this?

xenophyle’s picture

No matter what you specify in the pathauto patterns, the links in the tag cloud still go to taxonomy/term/, right? This patch is to change the links in the tagcloud.

It's ok if you don't think this is appropriate to add to this module; we just thought we might as well submit the functionality as a patch since it was useful for us in case someone else thought it was useful too. On our site we don't use the default taxonomy term pages, but rather pages provided by views, so we didn't want the tags in the tagcloud to link to the default taxonomy term pages.

MGParisi’s picture

I think it should default to what pathauto uses. From what you say it does not, so instead of specifying the path here, maybe have it integrate with pathauto. Does this make sense?

On the demonstration (which has pathauto) sometimes it uses the alias, other times it uses the term-id. I wonder what is causing this.

yngens’s picture

I tried to patch both 7.x-1.9 and 7.x-1.x-dev versions of the module and both times the patch produced hunk messages:

patch < *patch
patching file tagclouds.module
Hunk #2 succeeded at 419 with fuzz 1.
Hunk #3 succeeded at 448 with fuzz 2 (offset -2 lines).

mubiesam’s picture

Issue summary: View changes

Quite happy to find this patch which is exactly what we are looking for...but it seems not working as the same hunk messages are there...any suggestion?

MGParisi’s picture

This most likely was because you applied the patch to an incorrect version.

amitgoyal’s picture

StatusFileSize
new3.21 KB

I tried applying tagclouds-custom-urls-0.patch patch but it failed to apply in latest code of 7.x-1.x branch. Here is the issue shown,

$ git apply -v tagclouds-custom-urls-0.patch
tagclouds-custom-urls-0.patch:18: trailing whitespace.

tagclouds-custom-urls-0.patch:25: trailing whitespace.

Checking patch tagclouds.module...
error: while searching for:
*/
function tagclouds_display_term_link_weight($name, $tid, $weight, $description) {
if ($term = taxonomy_term_load($tid)) {
$uri = entity_uri('taxonomy_term', $term);
$uri['options']['attributes']['class'][] = 'tagclouds';
$uri['options']['attributes']['class'][] = 'level' . $weight;
$uri['options']['attributes']['rel'] = 'tag';

error: patch failed: tagclouds.module:381
error: tagclouds.module: patch does not apply

So I fixed the patch which can be applied in the latest 7.x-1.x branch. Please try applying the tagclouds-custom-urls-8.patch.

One thing I couldn't understand. I specified resources/[term:tid] in 'Custom tag urls' field under TagClouds configuration. The URLs get updated in the 'Tags in Tags' block. But when I click on that URL, it goes to 'Page not found'. If I specify the same pattern in Pathauto settings and do the bulk update then it works fine.

markchitty’s picture

For the record, I've applied the patch in #8 for the 7.x-1.9 version of the module and it works fine.

I'd also say that I'd consider this addition essential for my usage case of this module. Are there plans to include in the build?

MGParisi’s picture

Currently we are looking for new maintainers as I dont have a current test environment. I would be willing to see how this works and include it if possible.

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch in #8 failed to apply to the latest 7.x-1.x development snapshot, needs reroll.

Checking patch tagclouds.module...
Hunk #1 succeeded at 82 (offset 1 line).
error: while searching for:
 */
function tagclouds_display_term_link_weight($name, $tid, $weight, $description) {
  if ($term = taxonomy_term_load($tid)) {
    $uri = entity_uri('taxonomy_term', $term);
    $uri['options']['attributes']['class'][] = 'tagclouds';
    $uri['options']['attributes']['class'][] = 'level' . $weight;
    $uri['options']['attributes']['title'] = $description;

error: patch failed: tagclouds.module:387
error: tagclouds.module: patch does not apply
grask0’s picture

Status: Needs work » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.