PDA

View Full Version : Images in Articles


David Karol
05-11-2016, 03:38 PM
On vBulletin 4, after pushing an article link via RSS, or pasting a link into Facebook, images were recognized by the platforms. This is not the case in vBulletin 5.

I'd look for diffs in the content between 5 and 4, does anyone know of a vBulletin 4 site running that utilizes the CMS?

twistsol
05-11-2016, 04:22 PM
We have about 200 CMS articles at www.sawdustzone.org and we're on VB 4.2.3 for another two weeks

David Karol
05-12-2016, 06:38 PM
Could the issue be that vb4 points to a real URL, where vb5 uses 'file data' variable to point to an image?

David Karol
05-13-2016, 03:08 AM
Looks like some meta data is missing. I filed http://tracker.vbulletin.com/browse/VBV-15998

David Karol
05-17-2016, 01:08 AM
Looks like some meta data is missing. I filed http://tracker.vbulletin.com/browse/VBV-15998

Is there an easy way to add schema tags inside every image tag?

itemprop="image"

David Karol
05-24-2016, 04:14 AM
Could something like below, in head_include possibly cover it?

$('div.post-content img').attr('itemprop', 'image')
$('div.post-content img').attr('property', 'og:image')

noypiscripter
05-24-2016, 03:45 PM
No. Dynamic front-end changes on the fly via Javascript are not visible outside of the browser executing it. This means external sites like Facebook that scrapes the page will not see those changes. What they will see are basically what you see when you view the page source (View-Source) which is what the server outputs when you make a request.

--------------- Added 1464112733 at 1464112733 ---------------

What you need to do is create a template hook in the header_head hook location. In the template, you need to retrieve the first attached image in the article. Once you get it, you can render appropriate open graph meta tags.

The code for this is not simple. This will require time and effort to do. You could hire me or someone else to do this for you.