Quantcast
Channel: myThemeshow customize tag cloud widget – myThemes
Viewing all articles
Browse latest Browse all 8

Reply To: how customize tag cloud widget

$
0
0

We have a similar widget “myThem.es: Post Tags” – show the tags from current post ( to use only for single post ).

code is in file: verbo/fw/plg/my_widgets/my_wdg_post_tags.php

also for Tag Cloud widget we make some changes ( on the DOM ) with jQuery script like this:

    /* TAGS WITH COUNTER */
    jQuery( 'div.widget_tag_cloud div.tagcloud' ).append( '
' ); jQuery( 'div.widget_tag_cloud div.tagcloud a, div.widget_post_tags div.tagcloud a' ).each(function(){ jQuery( this ).removeAttr( 'style' ); jQuery( this ).removeAttr( 'class' ); var text = jQuery( this ).text(); var nr = jQuery( this ).attr( 'title' ).split( " " )[0]; jQuery( this ).html( '' + '' + '' + text + '' + '' + nr + '' + '' ); var icon = jQuery( this ).find( 'span.icon' ); var name = jQuery( this ).find( 'span.tag-name' ); var counter = jQuery( this ).find( 'span.counter' ); var icon_width = icon.outerWidth(); var counter_width = counter.outerWidth(); var diff = counter_width - icon_width; var name_width = name.outerWidth(); var width = 0; if( diff < 0 ){ diff = 0; width = name_width + icon_width; counter.css({ 'width' : icon_width + 'px' }); }else{ width = name_width + counter_width; } counter.css({ 'margin-left' : diff + 'px' }); jQuery( this ).css({ 'width' : width + 'px' }); });

script is located in to: verbo/media/js/functions.js line 62 - 100


Viewing all articles
Browse latest Browse all 8

Trending Articles