Support » Plugin: Share This Image » Can I add unique text string to shares

  • Resolved tomiqa

    (@tomiqa)


    I like to extend the sharing description with a short text string

    e.g. “defualt description” + Visit our store!

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    So, as I understand, you want to add this text to the end of every image description.
    If so then yes, it is possible, but you will need to made some little changes in the plugins code.

    Please open share-this-image/assets/js/sti.js file, find lines

    data.page     =  opts.sharer ? opts.sharer + '?url=' + encodeURIComponent(data.link) + '&img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.ssl + data.hash :
    											   data.local + data.schar + 'img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.locUrl + data.ssl + data.hash;

    and after them add

    data.summary = data.summary + ' Visit our store!';

    Regards

    Thread Starter tomiqa

    (@tomiqa)

    Can you please explain how the content which shared should be look like in a perfect case?

    I just got this from Yoast Woocommerce Seo plugin

    Have more people clicking your products on social networks
    Because you can enter Facebook/Pinterest-specific details so Pinterest and Facebook can show details like price, stock and a clear link to your website in for instance rich pins. Check this comparison:

    BTW you can check my site here

    Thread Starter tomiqa

    (@tomiqa)

    I’m asking because I see strange things like this, what I don’t see with other sharing plugins (tho they are sharing the page not the image)

    This is a Twitter share:

    abstract colorful circular clip art, logo, symbol. mandala motif – StockVectorsIllustrations https://stockvectorsillustrations.com/illustration/abstract-colorful-circular-clip-art-logo-symbol-mandala-motif-138/?img=stockvectorsillustrations.com/wp-content/uploads/abstract-colorful-circular-clip-art-logo-symbol.-mandala-motif-8639.jpg&title=abstract%20colorful%20circular%20clip%20art%20logo%20symbol.%20mandala%20motif%20%20StockVectorsIllustrations&desc=abstract%20colorful%20circular%20clip%20art%20logo%20symbol.%20mandala%20motif%20%20StockVectorsIllustrations&network=twitter&ssl=true

    • This reply was modified 1 year ago by tomiqa.
    Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Well it is normal plugin behavior because unlike other sharing plugins this one shares exact selected image and text, not just the default page content. For this plugin need some customizations for sharing URL that you can see for twitter sharing.

    Thread Starter tomiqa

    (@tomiqa)

    Hello!

    The appending to the share text doesn’t work.

    Edit: It doesn’t even share the images now.

    This is what the code looks like:

    data.page = opts.sharer ? opts.sharer + ‘?url=’ + encodeURIComponent(data.link) + ‘&img=’ + data.media.replace(/^(http?|https):\/\//,”) + ‘&title=’ + encodeURIComponent(methods.replaceChars(data.title)) + ‘&desc=’ + encodeURIComponent(methods.replaceChars(data.summary)) + ‘&network=’ + network + data.ssl + data.hash :

    data.summary = data.summary + ‘ Visit our store!’;

    • This reply was modified 11 months, 2 weeks ago by tomiqa.
    Plugin Author ILLID

    (@mihail-barinov)

    It is invalid code. Code must looks like

    data.page     =  opts.sharer ? opts.sharer + '?url=' + encodeURIComponent(data.link) + '&img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.ssl + data.hash : data.local + data.schar + 'img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.locUrl + data.ssl + data.hash;
    
    data.summary = data.summary + ‘ Visit our store!’;
    Thread Starter tomiqa

    (@tomiqa)

    I copied the code as is

    This is the result with no effect:

    The code, again:

    data.page = opts.sharer ? opts.sharer + ‘?url=’ + encodeURIComponent(data.link) + ‘&img=’ + data.media.replace(/^(http?|https):\/\//,”) + ‘&title=’ + encodeURIComponent(methods.replaceChars(data.title)) + ‘&desc=’ + encodeURIComponent(methods.replaceChars(data.summary)) + ‘&network=’ + network + data.ssl + data.hash : data.local + data.schar + ‘img=’ + data.media.replace(/^(http?|https):\/\//,”) + ‘&title=’ + encodeURIComponent(methods.replaceChars(data.title)) + ‘&desc=’ + encodeURIComponent(methods.replaceChars(data.summary)) + ‘&network=’ + network + data.locUrl + data.ssl + data.hash;

    data.summary = data.summary + ‘ Visit our store!’;

    The buttons not even appearing, https://stockvectorsillustrations.com/illustration/grunge-grungy-geometric-circle-element-edgy-roughy-borders-30/

    • This reply was modified 11 months, 1 week ago by tomiqa.
    Thread Starter tomiqa

    (@tomiqa)

    Can you give me a heads up on this?

    ty

    Plugin Author ILLID

    (@mihail-barinov)

    Ops, looks like I mix up the order. Please use instead

    data.summary = data.summary + ‘ Visit our store!’;
    
    data.page     =  opts.sharer ? opts.sharer + '?url=' + encodeURIComponent(data.link) + '&img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.ssl + data.hash : data.local + data.schar + 'img=' + data.media.replace(/^(http?|https):\/\//,'') + '&title=' + encodeURIComponent(methods.replaceChars(data.title)) + '&desc=' + encodeURIComponent(methods.replaceChars(data.summary)) + '&network=' + network + data.locUrl + data.ssl + data.hash;
    • This reply was modified 11 months, 1 week ago by ILLID.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can I add unique text string to shares’ is closed to new replies.