Jump to content

MarkupSocialShareButtons


Soma

Recommended Posts

Hi, @Macrura,  thank you. Yes this was te first things that i did, I setup well the meta tag, indeed when share the link on social I can see all information uploaded correctly. The problem is only using the modulo.

Hi @Soma, thank you for reapply me. I link this method, but when I try to use the options array show up an alert message that says: Error: Call to a member function httpUrl()

I try to use a different array like call just:  "media" => $page->my_field  but anyway give ma beck a Error: Call to a member function  render()


     

Link to comment
Share on other sites

1 hour ago, MarcoPLY said:

Hi, @Macrura,  thank you. Yes this was te first things that i did, I setup well the meta tag, indeed when share the link on social I can see all information uploaded correctly. The problem is only using the modulo.

Hi @Soma, thank you for reapply me. I link this method, but when I try to use the options array show up an alert message that says: Error: Call to a member function httpUrl()

I try to use a different array like call just:  "media" => $page->my_field  but anyway give ma beck a Error: Call to a member function  render()


     

It depends on your image field. If it's multiple you need to select one first. ie $page->images->first->httpUrl(): 

  • Like 1
Link to comment
Share on other sites

Thank you @Soma for the good tips. ok so, now if I use this: "media" => $_SERVER['HTTP_HOST'].$page->image_card  now when I inspector the pop box in the src tag I can see the correct link on the image.  I think when I will go online I will see the image. 

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

When I share on (eg) Facebook, after the click on the icon it's open a windows like this one:

812769920_Schermata2018-05-03alle12_45_12.png.bc3f0402e084df35df5db1af2921923f.png

And only if i click many times on the Share Button that load the image and description. 

why this happen? is there anything I can do to make the window with img and text load immediately after click on the icon?

Link to comment
Share on other sites

44 minutes ago, MarcoPLY said:

Hi,

When I share on (eg) Facebook, after the click on the icon it's open a windows like this one:

812769920_Schermata2018-05-03alle12_45_12.png.bc3f0402e084df35df5db1af2921923f.png

And only if i click many times on the Share Button that load the image and description. 

why this happen? is there anything I can do to make the window with img and text load immediately after click on the icon?

Ask Facebook. As far as I understand it, it's because FB caches the data and on first call it sometimes doesn't show in the dialog (but when posted or shared again the same url).

Link to comment
Share on other sites

ok understand. so this is something new, I had seen on other sites this module work well. How did you solve for your sites now? I mean, you keep use this modules or add the facebook share button? 

Link to comment
Share on other sites

Link to comment
Share on other sites

yes I have add title and text, sorry. now I have delete it and let only ?url={url} but not change. 

I had added those tags to prove if they were needed. But even without works in the same way.

Link to comment
Share on other sites

9 minutes ago, MarcoPLY said:

yes I have add title and text, sorry. now I have delete it and let only ?url={url} but not change. 

I had added those tags to prove if they were needed. But even without works in the same way.

It's ?u= not ?url=

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

Hi @Soma, thanks for the module!

See UPDATEs below.

I'm using ProcessWire 3.0.98 and the CSS styling seems not to work even if the CSS classes are added to the HTML source code. That is, I get the following:

1923471809_ScreenShot2018-06-29at02_51_53.png.a48dd7a2e8c6da206649d614715a4d00.png455873524_ScreenShot2018-06-29at02_59_09.png.7ac9661b62ae0e76b334761515ec6bc1.png

However, in the module configuration page, the preview looks good:

1526801529_ScreenShot2018-06-29at02_56_18.png.fabe307781931d551ee8ab92a1198dfd.png

 

UPDATE - By inspecting the CSS code I just discovered unwanted style properties added to the page (note: the CSS that the MSSB module would add is still not loaded):

98508383_ScreenShot2018-06-29at03_18_40.png.964f30b4dc79a8ff923adfe5ce0275d6.png

I don't know why it happens and probably it's not directly related to MSSB, but it would be great if anyone can help. ?

 

SOLVED - I just discovered I should had been including the theme.css file present in the MSSB theme folder to my site. That is, to use:

<link rel="stylesheet" type="text/css" href="path/to/theme.css" />

Alternatively, I should had been adding the CSS statements in my website CSS file.

Link to comment
Share on other sites

  • 2 months later...

Hey @Soma - I just noticed a bug with overriding options.

This is my $options array:

            $options = array(
                "theme" => "templates/social_themes/ms2s",
                "outer_wrapper_tag" => "span",
                "item_wrapper_tag" => "span style='float:left' ",
                "text" => $page->share_email_text,
                "char_limit" => 9999
            );

However, the char_limit isn't being respected. The problem is these lines:

https://github.com/somatonic/MarkupSocialShareButtons/blob/7b25cf4098a23ab79ea423082ecd200bc7a06590/MarkupSocialShareButtons.module#L381

https://github.com/somatonic/MarkupSocialShareButtons/blob/7b25cf4098a23ab79ea423082ecd200bc7a06590/MarkupSocialShareButtons.module#L402

$this->char_limit

and 

$this->char_limit_sypnosis 

need to be

$this->options['char_limit'] 

and

$this->options['char_limit_synopsis'] 

respectively.

Thanks!

Link to comment
Share on other sites

Looks like there are lots of other issues along the same lines. So far I have also come across trying to set the "twitter_params" option. It is not sticking because this line:

$params = $this->get($item . "_params");

needs to be:

$params = $this->options[$item . "_params"];

but there are lots of other instances like this as well that I think need changing.

Thanks again.

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

Hi, Soma!

Thanks for cool module! I use version 1.0.4 & php 7.0 and this is my problem. I have needed to add some new social networks. By you instruction I added some array in $config->MarkupSocialShareButtonsServices variable, but saw nothing. Because in __construct():

Quote

isset($this->config->MarkupSocialShareButtonsServices) == false

i make some tests:

Quote

empty($this->config->MarkupSocialShareButtonsServices) == true
is_null($this->config->MarkupSocialShareButtonsServices) == false
echo $this->config->MarkupSocialShareButtonsServices - print right array

what do you think about?

tnx

Link to comment
Share on other sites

  • 1 year later...

I made it work with the instructions in Github.

$config->MarkupSocialShareButtonsServices = array(
    "example" => array(
        "example_url" => "http://exampleurl.com/",
        "example_params" => "?url={url}&description={text}",
        "example_icon" => "<img src='{themeUrl}png/example.png'>",
        )
    );

Using:

https://api.whatsapp.com/send?text={url}

Thank you!

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

nice module.

Could you also make it possible to just copy the current url? 

What I mean is add another button that when clicked copies the current url to the clipboard. I'm trying to accomplish that with the current options of the module but no luck. Maybe if I could hook the function before rendering there would be a chance…

  • Like 1
Link to comment
Share on other sites

also, sharing via facebook is not embedding the image. It seems to work fine with twitter and linkedin but not facebook.

I'm using the module MarkupSEO to declare the social media image. When simply sharing the page-url on social media platforms manually, it seems to work fine, so that module doesn't seem to be the problem.

However, I added 

<meta property="og:image:url" content="<?php echo 'http://'.$_SERVER['HTTP_HOST'].$page->poster->url; ?>" />

(as suggested further up) in case that's required for fb because the MarkupSEO-module doesn't provide that tag.
Doesn't help though.

And then also, I do not quite understand what the following means

?u={url}&title={title}&text={text}&media={media}

these are placeholders? what goes in here for real?

Lastly, I should mention that on the page itself, the image is not displayed, i.e. not included in the <body>, because it would be redundant with an embedded iframe on the page, so we left it out. Don't know if that's the issue. 

Thanks for help! 

Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

Installation is causing a fatal error. Screenshot attached. Running ProcessWire latest master. Any thoughts? Any alternatives? Thanks in advance.

Screenshot 2024-09-21 at 16.47.24.png

Back on the modules page, I see this: (second screenshot)

 

Screenshot 2024-09-21 at 16.53.28.png

Edited by DrewPH
Adding 2nd screenshot
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...