Open Graph - Please expand other plugin code to get article image

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Open Graph - Please expand other plugin code to get article image

Post by canvon »

Hi,

I've now tried the Phoca Open Graph Plugin together with Phoca Gallery Plugin, and it doesn't find the article image produced by phocagallery plugin code. I've set the plugin order so that the open graph plugin should be running after the gallery plugin. Also I've set open graph plugin options -> Common Options -> Image (Parameter) Order to Last.

In "Setting of images in open graph", point 5), you state:
5) If no image is set in plugin parameters or article parameters, Phoca Open Graph plugin tries to find an image inside the article. If some is found, such will be used in og:image meta tag.
Please also expand plugin code during the in-article image search in 5). If that would be easier, please at least expand your own gallery plugin's code to an image specially.

The reason I'm interested in this is that the site owner shall be able to upload images (this works! using your gallery) and create articles from them (which uses your button plugin and, after that, your gallery plugin; this workflow seems to be slightly too complicated already). The same image shall then appear when sharing on Facebook. If you say it's impossible or otherwise wontfix, I could *possibly* teach the site owner to manually set the mid-size preview image generated by your gallery as article intro image manually, but that would lose the ability to click on it in the blog view and get the enlarged view and then switch through all phocagallery-plugin-generated images on the blog view by simple further clicks inside the image. (I don't know whether this is an explicit feature or rather an accident with the options used here, but this is quite nice.)

Regards,
Fabian
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Re: Open Graph - Please expand other plugin code to get article image

Post by canvon »

Interestingly, in the Category view, it finds the image from the same article.

Bug: The result is https://www.barbara-pietsch.de/joomla// ... 094237.jpg which should rather be https://www.barbara-pietsch.de/joomla/i ... 094237.jpg -- that is, an absolute URI /joomla/... is handled wrong, or rather, you can't assume that the full site URL can be prepended to an URI (if it is absolute).
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please expand other plugin code to get article image

Post by Jan »

Hi, see other post in this forum, there is a problem because when looking at the article text, not sure if you get the text with the content plugins or not, I need to take some research. Second problem can be a memory problem, because searching inside different plugins can be very problematic :-(

Category, Image - did you test the code, do you have any ideas regarding changing the code so I can take a look at it, thank you.

Jan
If you find Phoca extensions useful, please support the project
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Re: Open Graph - Please expand other plugin code to get article image

Post by canvon »

Hi

For the URI problem I have a patch: https://files.canvon.de/patch/joomla/pl ... nvon1.diff

The essence is to use JURI's setPath() when the gathered image URI is starting with '/'. (This is still wrong for when it starts with "//" but you get the idea.) I suggest putting this into a helper function.

Hope this helps,
Fabian
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please expand other plugin code to get article image

Post by Jan »

Hi, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please expand other plugin code to get article image

Post by Jan »

Hi, added in version 3.1.1 (Content Plugin) and 3.0.3 (System Plugin)

https://www.phoca.cz/news/958-phoca-ope ... 3-released


Jan
If you find Phoca extensions useful, please support the project
Post Reply