Topic-icon Open Graph Tag via url linter

Active Subscriptions:

None
9 years 7 months ago - 9 years 7 months ago #47413 by mohkha1
Using URL Linter

this page (K2 blog) >> www.essenshealth.com/blog/item/7-benefit...old-in-cosmetic.html
the output >> prntscr.com/4s1f8q

this page (Virtuemart Product detail page) >> www.essenshealth.com/shop/all-categories...eme-plus-detail.html
the output >> prntscr.com/4s1fxz

Both not showing correctly.

as for Virtuemart the open graph for product detail page shud use the following;

$og_type = 'article';
$og_url = JURI::current();
$og_image = JRoute::_(JURI::base().$this->product->images[0]->file_url);
$og_desc = $this->product->product_s_desc;
$og_title = $this->product->product_name;$app =& JFactory::getApplication();
$og_sitename = $app->getCfg('sitename');

Not this;
$doc = JFactory::getDocument();$doc->addCustomTag('<meta property="og:type" content="article"/>');
$doc->addCustomTag('<meta property="og:url" content="'.$og_url.'"/>');
$doc->addCustomTag('<meta property="og:site_name" content="'.$og_sitename.'"/>');
$doc->addCustomTag('<meta property="og:image" content="'.$og_image.'"/>');
$doc->addCustomTag('<meta property="og:description" content="'.$og_desc.'"/>');
$doc->addCustomTag('<meta property="og:title" content="'.$og_title.'"/>');

any suggestion? As for virtuemart, shud i disable the JFB Social plugin parameter and manually add OG tag?
Last edit: 9 years 7 months ago by mohkha1.
The topic has been locked.
Support Specialist
9 years 7 months ago #47423 by alzander
When I run the Twitter Card validator on your pages, it keeps returning "ERROR: Internal server error" and "Unable to render card preview". I'm not sure why that is, but when I use a tool like Social Debug , the output is correct. Twitter may just be having issues re-scanning your pages to get the latest data.

As for your code snippets above, I'm not sure where you're seeing either of those blocks of code. If you need to set your own custom tags, the proper way to do it is with the following easy tags:
{SCOpenGraph image=<?php echo JRoute::_(JURI::base().$this->product->images[0]->file_url); ?>}
{SCOpenGraph description=<?php echo $this->product->product_s_desc; ?>}
You don't need to set the URL, type or site_name properties as JFBConnect will set those automatically.

I hope that helps explain, but if you need anything else, just let me know.

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

None
9 years 7 months ago #47426 by mohkha1

alzander wrote: When I run the Twitter Card validator on your pages, it keeps returning "ERROR: Internal server error" and "Unable to render card preview". I'm not sure why that is, but when I use a tool like Social Debug , the output is correct. Twitter may just be having issues re-scanning your pages to get the latest data.

As for your code snippets above, I'm not sure where you're seeing either of those blocks of code. If you need to set your own custom tags, the proper way to do it is with the following easy tags:

{SCOpenGraph image=<?php echo JRoute::_(JURI::base().$this->product->images[0]->file_url); ?>}
{SCOpenGraph description=<?php echo $this->product->product_s_desc; ?>}
You don't need to set the URL, type or site_name properties as JFBConnect will set those automatically.

I hope that helps explain, but if you need anything else, just let me know.

Thanks,
Alex


When i put that in /home/<username>/public_html/templates/ja_hawkstore/html/com_virtuemart/productdetails/default.php

Page become blank and below log were generated;

[01-Oct-2014 23:32:45 Asia/Kuala_Lumpur] PHP Parse error: syntax error, unexpected T_STRING in /home/essenshe/public_html/templates/ja_hawkstore/html/com_virtuemart/productdetails/default.php on line 24
The topic has been locked.
Support Specialist
9 years 7 months ago #47431 by alzander
Those statements should be placed in the HTML portion of the page. They are not PHP executable statements. In straight HTML, you could use the tags like:
{SCOpenGraph description=My Great Description for this page}
The tags above combine PHP as well, but should not be placed within a PHP block on their own.

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

None
9 years 7 months ago - 9 years 7 months ago #47463 by mohkha1
Alex,

If i have 1000 product in Virtuemart then i need to add it one by one. Believe there should be other better way to implement this.

The objective is simple. I want to ensure for Virtuemart product detail page;
- og:image= $this->product->images[0]->file_url
- og:description = $this->product->product_s_desc

Please advise on how to achieve this using JFB plugin?

Tq
Last edit: 9 years 7 months ago by mohkha1.
The topic has been locked.
Support Specialist
9 years 7 months ago #47475 by alzander
The code above is still correct. You can use PHP within our Easy Tags. The Easy Tag itself should not be within another PHP block though. When added to your flypage, it would look something like:
?>
{SCOpenGraph image=<?php echo JRoute::_(JURI::base().$this->product->images[0]->file_url);?>}
{SCOpenGraph description=<?php echo $this->product->product_s_desc; ?>}
<?php
Please notice how it's outside of a PHP block and not inside a <?php .. ?> block

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

None
9 years 7 months ago - 9 years 7 months ago #47479 by mohkha1
thanks Alex

i already include easy tag in VM product detail page >> prntscr.com/4sdkjd
{SCOpenGraph image=<?php echo JRoute::_(JURI::base().$this->product->images[0]->file_url);?>}
{SCOpenGraph description=<?php echo $this->product->product_s_desc;?>}

But the result still fail >> prntscr.com/4sdk63

Appreciate your expert advise. Tq
Last edit: 9 years 7 months ago by mohkha1.
The topic has been locked.
Support Specialist
9 years 7 months ago #47510 by alzander
The tags look right in your PHP file, but I'm not seeing those reflected in the tags on the page. Can you:
* Disable any caching that may be enabled on your site.
* Update the code to look like:
TEST{SCOpenGraph image=<?php echo JRoute::_(JURI::base().$this->product->images[0]->file_url);?>} 
{SCOpenGraph description=<?php echo $this->product->product_s_desc;?>}
TEST
You should see TESTTEST output on your page somewhere, with the tags being properly removed by JFBConnect. If TESTTEST isn't displaying, it means that your edit is in the wrong file.

Hopefully that helps you narrow things down, but if you need more help, just let me know.

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

None
9 years 7 months ago - 9 years 7 months ago #47522 by mohkha1
yup it is a correct file >> prntscr.com/4srrlt
www.essenshealth.com/shop/all-categories...sturiser-detail.html
So what to do next? tq
Last edit: 9 years 7 months ago by mohkha1.
The topic has been locked.
Support Specialist
9 years 7 months ago #47529 by alzander
Alright.. the last test I can think of is to disable the JFBCSystem plugin. Then, the raw SCOpenGraph tag should actually appear on the page. Make sure that the values are correct and/or please post what the resulting output is so we can see what JFBConnect is trying to parse (when using your PHP values) and that will hopefully help determine the issue.

Thanks,
Alex
The topic has been locked.