select landing page for tagadelic terms

bjraines - April 24, 2007 - 03:21
Project:Views Tagadelic
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

is it possible for the landing page for the terms in the could to be a view itself? so when a term is clicked out you could be taken to a sortable list?

#1

douggreen - May 1, 2007 - 23:53
Category:feature request» support request

You have two options:

  1. implement a hook_term_path and return a different link for the term
  2. implement a theme_tagadelic_weighted and output anything you want

#2

patchak - May 5, 2007 - 13:37

I'd also like to redirect terms to a custom destination of my choice. With the same term argument added at the end. Would you mind please give a little more details on how I could redirect the terms? You mentionned something about theme_tagadelic_weighted, would you mind explaining a little but how to implement this?

Thanks

#3

douggreen - May 6, 2007 - 12:20

#4

patchak - May 6, 2007 - 16:07

Hey there,
Thanks for the link, I read the 3 scenarios, and I'm afraid that not any of them really suits what I need to do.

I want to override the link destination of one view only. Not for a whole vocab, but only for a specific view. I created a view that pulls out allthe tags used by user/X (as the arg for the view) and I then display those tags as a tagcloud using your module. The thing is I want to use that tag cloud to actually point the link to a special view I would use which is a view where the first argument is the userID and the second is the TID.

So when clicking on any term outputted by the view, the visitor would see a display of all nodes that have the tag and that were added by the user who's profile page the visitor is looking at.

So for example, I use a country vocab, and when going to a user's page, I click on Bolivia, I would see all content added by that user under the country Bolivia.

For this it seems to me I need to override only that specific view, and not the whole vocab, since when you browse on the site, and click Bolivia, you obvioulsy want to see all content tagged Bolivia.

So I guess my question is: how can I override a single view so that I can hiack the term links and make them point where I want, but without having to redirect the whole vocab??

Thanks

#5

Owen Barton - May 10, 2007 - 17:50

Yes - you can do what you need using Option 3 - theming _just_ the links in the tag cloud to point to your alternate views listing URL.

#6

patchak - May 12, 2007 - 19:42

Hi again,

Sorry for being dense about this issue but :

function _phptemplate_tagadelic_weighted($terms) {
  foreach ($terms as $term) {
    $output .= l($term->name, 'yourviewurl', array('class'=>"tagadelic level$term->weight"), 'tid='. $term->tid) ." \n";
  }
  return $output;
}

I don't see how adding this code could override only for one view?? Wehre do I actually tell this code what view it needs to change??

Thanks for your help!

Patchak

#7

douggreen - May 12, 2007 - 21:47

I've added a second level of theming to allow you to catch the view. Checkout the latest module (1.1.2.1) and override theme_tagadelic_views($tags, $view).

#8

levavie - August 24, 2007 - 14:23

Another strategy which I've found useful is to use pathauto to bulk modify the URLs of existing category pages.

Advantages: No need for coding - relies on the standard taxonomy mechanism - and great for SEO.

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

#9

marcoBauli - November 17, 2007 - 13:34

hi queue,

i'm actually looking to override different Tagadelic views differently too.
@patchak: can i ask if you did get there in the end, and eventually how?
@douggreen: would you mind elaborate #7 if you find the time?

thanks for any light you might shred

EDIT: just in case someone else might be interested, the use case is the following:

SETUP:
. 3 content types (resources, articles, tips) and 3 corresponding site sections
. 1 freetagging vocabulary applied to all 3 types

USE CASE:
. display a tag cloud on each section showing *only* terms for that relative content type
. each term links to a view that shows *only* content of that specific type, tagged with that specific term

#10

douggreen - November 21, 2007 - 12:47
Status:active» closed

i'm closing the issue, others are free to add comments, but I won't be able to "find the time" to elaborate any more, sorry :(

#11

marcoBauli - November 26, 2007 - 19:02

here's the right way to obtain what i was looking for above in case someone else is interested:

function phptemplate_tagadelic_weighted($terms) {
if(arg(0) == 'articoli') {
$type_tid = 1;
}
if(arg(0) == 'appunti') {
$type_tid = 3;
}
foreach ($terms as $term) {
$output .= l($term->name, _tagadelic_taxonomy_term_path($type_tid, $term), array('class'=>"tagadelic level$term->weight")) ." \n";
}
return $output;
}


function _tagadelic_taxonomy_term_path($type_tid, $term) {
$vocabulary = taxonomy_get_vocabulary($term->vid);
if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) {
return $path;
}
return 'taxonomy/term/'. $type_tid . ',' . $term->tid;
}

#12

olafke - March 27, 2008 - 12:00

Hi,

I had the same problem, used the theme hoook theme_tagadelic_weighted from the tagadelic.module and the theme_tagadelic_views from the tagadelic_views.module and it worked perfectly fine for me.

The code goes into the template.php . For details view the comments in the code

##############Functons that change the links of tags specific to views####################

/*write a "weighted_mytags" function for each tagadelic view you want to have different link destinations. "pushbutton" is the name of my theme, replace it with your theme's name */

function pushbutton_tagadelic_weighted_mytags($terms) {
//this is the function for which redirects paths to "bookmarks/meine/tags/term->tid"


  foreach ($terms as $term) {
    $output .= l($term->name, 'bookmarks/meine/tags/'.$term->tid, array('class'=>"tagadelic level$term->weight", 'rel'=>'tag')) ." \n";
  }
  return $output;
}

function pushbutton_tagadelic_weighted_normal($terms) {
//this is the standard function copied from tagadelic.module

  foreach ($terms as $term) {
    $output .= l($term->name, taxonomy_term_path($term), array('class'=>"tagadelic level$term->weight", 'rel'=>'tag')) ." \n";
  }
  return $output;
}

function pushbutton_tagadelic_views($tags, $view) {
//this is the theme_tagadelic_views from tagadelic_views.module


 
  if($view->name == "tagcloud_meine_bookmarks"){
//"tagcloud_meine_bookmarks" is the name of the view I want to have diffferent links for

  return theme('tagadelic_weighted_mytags', $tags);
  }
  else{ 
// for all other views retrun the standard link
 
   return theme('tagadelic_weighted_normal', $tags);
   
  }
 
}

#13

momper - August 11, 2008 - 07:35

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.