Music Affiliate Pro
classing links (3 posts)

  1. indelible heff
    Posted 3 years ago #

    Hi Gents, what Js file would I edit to add some classes to the links added into articles by the plugin? We can have some nice default styles then.

    When I have it creating dynamic links (itunes/spotify/amazon etc) I'll post my code back up.



  2. Brady Vercher
    Plugin Author

    Posted 3 years ago #

    The link that's inserted into the editor is created in js/search.js. If you do make changes, I'd recommend backing them up since they'll be overwritten by any updates.

    Ideally, the classes would probably be added to a search result via a filter (one doesn't currently exist) and the javascript would pick them up when it creates the link.

  3. indelible heff
    Posted 3 years ago #

    I change line 80s function to the below code to get a link with an image, the track/album name, and artist name and somewhere to place a network logo.... This suits my needs perfectly Brady's code utilises the taget option on the link, mine forces it.

    I hope this helps someone else :)

    $(settings.resultsContainer).delegate('.ma-result', 'click', function(e) {
    				var defaultText = $('.title strong', this).text();
    				var defaultText2 = $(this).find('.artist').text();
    				var afftype ="";
    				var afftype = $('#ma-query-service').val();
    				var attrs = {
    					href : $(this).find('a').attr('href'),
    					target: '_blank',
    					class: 'affiliate affiliate-' +afftype
    				var tuneimage = $(this).find('img').attr('src');
    				if ($('#ma-link-target-blank').attr('checked') == 'checked') {
    					attrs.target = '_blank';
    				var linkHtml = $('<a><span class="aff-icon"></span><img src="'+tuneimage+'"/><span class="title">' + defaultText+'<span class="artist">'+defaultText2+'</span></a>').attr( attrs ).wrap('<div></div>').parent('div');
    				tuneEditor.sendLinkToEditor( linkHtml.html(), attrs, defaultText );

    Again, Thanks for the great plugin guys.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic