Topic-icon Facebook Page Plugin adaptive width

Active Subscriptions:

None
8 years 11 months ago #53614 by klox7
Hi,
is there parameter for JFB easy tags that supports "Adapt to plugin container width" parameter?
Regards
The topic has been locked.
Support Specialist
8 years 11 months ago #53616 by alzander
The Page Plugin automatically does this. If you set the width to a larger width than the column/container it's rendered in and there's not a specific option to have adapt to the container it's in.

With that said, please note that the width of the Page plugin is only determined at page load. It will not automatically resize if the window is enlarged or shrunk, but it does work in responsive templates.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 11 months ago #53620 by klox7
OK, I'm using Page Plugin to show it in one of my tabs (Bootstrap). I'm using JFB easy tag with width=500 snippet. I also wrapped JFB easy tag with <div style="width: 500px">. But somehow when I wait for the page to fully load and then click on Page Plugin tab the plugin width is only 180px. If I go to Page Plugin tab while page is loading then it will show correctly.
Do you maybe have any idea why is that?
The topic has been locked.
Support Specialist
8 years 11 months ago #53625 by alzander
Can you let us know a URL we can see the Page plugin behaving this way? Without seeing the issue and your HTML, it's difficult to make a guess as to what is happening.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 11 months ago #53630 by klox7
Where can I insert private (hidden) text?
The topic has been locked.
Support Specialist
8 years 11 months ago #53631 by alzander
You can send a private message by clicking the mail icon under my name to the left. Additionally, we can see what URLs you've run Autotune from, so if the domain is the last domain you ran Autotune from, you can simply post a relative URL and we'll know what domain it's on.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #53689 by klox7
Did you maybe take a look at it?
The topic has been locked.
Support Specialist
8 years 10 months ago #53695 by alzander
Sorry for the delay. I had a quick look a few days ago, but didn't have any great ideas on what was happening. I just looked again and was able to investigate further. Basically, it seems like Facebook is detecting that the Page plugin is being shown in a div that is hidden. Because of that, it's thinking it should use the minimum size available to it, which is 180px.

To test my theory, can you try putting the Page plugin into the main "Gallery" tab on the page so it's always shown? I'm assuming then that the width will always be detected properly and resized accordingly. A further tests you can do is quickly click to the "Social Media" tab before the page loads. Then, go back to the gallery and confirm that the Page plugin is only 180px since, at page load completion, that tab would be hidden.

If that proves out my theory, then it sounds like a Facebook issue that we wouldn't be able to fix. At that point, I'd recommend submitting it as a bug report to Facebook:
developers.facebook.com/bugs

I hope that helps narrow things down.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago - 8 years 10 months ago #53696 by klox7
OK, it makes sence that if div is hidden FB will show minimum value but I have assigned width in JFB easy tag as width=410. For now I will move them out because I saw that Facebook added bottom limit back to 180px instead of 280px.

I have another question if you maybe know something. Everytime the page loads those buttons and plugins are loaded last with high delay. Can I somehow load them quicker?
Last edit: 8 years 10 months ago by klox7.
The topic has been locked.
Support Specialist
8 years 10 months ago #53697 by alzander
Interestingly, I just went to Facebook's developer page to provide you a link for more information on their adaptive width feature. It looks like they've added a new setting that allows you to disable that. We don't have that option in this plugin yet, but you can add it easily. To do so, please edit the /components/com_jfbconnect/libraries/provider/facebook/widget/pageplugin.php file. Around line 33, you'll see:
$tag .= $this->getField('href', 'url', null, '', 'data-href');
Add the following directly underneath that:
$tag .= $this->getField('adapt_width', null, 'boolean', '', 'data-adapt-container-width');
Then, you can update your tag with the new adapt_width setting, like:
{JFBCFacebookPagePlugin width=400 url=<your FB page> adapt_width=false}
You shouldn't need the container div anymore to make that work. The issue with the hidden div is that, even if it has a width of 400px, it's still hidden.. so the width doesn't matter when Facebook is checking. It comes back as 'none'.

Please test and let us know how that goes. We can get this into the next release as well, but would love to have your feedback.

Thanks,
Alex
The topic has been locked.