We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30897
    • 311 Posts
    Hi,

    Some news about the "min" function ?

    Thx
      TylerD - In MODx we trust
      [Derni
      • 36592
      • 970 Posts
      Quote from: TylerD at Jan 17, 2008, 03:24 AM

      Some news about the "min" function ?
      How about supress displaying the tag like this ?
       
      if( $min == 0 || ( $min > 0 && $count >= $min ) ) {
        if ($displayType == 'cloud') {
          $output .= '<span><a class="' . $this_style . '" href="[~' . $landing . '~]?' . $dittoId . 'tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . $countvalues . '</a></span>';
          $output .= "\r\n";
        } else {
          $output .= '<li><a class="' . $this_style . '" href="[~' . $landing . '~]?' . $dittoId . 'tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . ' ' . $countvalues . '</a></li>';
          $output .= "\r\n";
        }
      }
      
        • 23050
        • 1,842 Posts
        Yes ! Works perfect ! wink

        Thank you tkfm smiley

        (Thank you Tyler for having reposted here ^^)
          • 30897
          • 311 Posts
          Thx... wink
            TylerD - In MODx we trust
            [Derni
            • 8883
            • 59 Posts
            erm, in which line I have to insert the code?
              • 23050
              • 1,842 Posts
              At the end of the snippet code, you have :

              	if ($displayType == 'cloud') {
              		$output .= '<span><a class="' . $this_style . '" href="[~' . $landing . '~]?tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . $countvalues . '</a></span>';
              		$output .= "\r\n";
              	} else {
              		$output .= '<li><a class="' . $this_style . '" href="[~' . $landing . '~]?tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . ' ' . $countvalues . '</a></li>';
              		$output .= "\r\n";
              	}
              


              Replace it with

              if( $min == 0 || ( $min > 0 && $count >= $min ) ) {	
              	if ($displayType == 'cloud') {
              		$output .= '<span><a class="' . $this_style . '" href="[~' . $landing . '~]?tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . $countvalues . '</a></span>';
              		$output .= "\r\n";
              	} else {
              		$output .= '<li><a class="' . $this_style . '" href="[~' . $landing . '~]?tags=' . urlencode($tag) . '" title="'.$this_tooltip.'">' . $tag . ' ' . $countvalues . '</a></li>';
              		$output .= "\r\n";
              	}
              }
              
                • 36592
                • 970 Posts
                Quote from: Perrine at Jan 17, 2008, 05:06 AM

                if( $min > 0 && $count >= $min ) {
                Sorry, I changed this "if" sentence as following...
                if( $min == 0 || ( $min > 0 && $count >= $min ) ) {
                

                  • 23050
                  • 1,842 Posts
                  Ok Thanks, didn’t notice it... works fine also... and changed my post above wink
                    • 8883
                    • 59 Posts
                    thx. worked
                      • 2912
                      • 315 Posts
                      I’ve been playing with tvTagCloud and Ditto and I’m trying to restrict the number of Tags returned back. I only really want the top 5 or maybe 10 tags.

                      I’ve searched around and just cant find an answer.

                      Can someone help me or point me in the right direction?

                      Thanks,
                        BBloke