object type in custom component

object type in custom component

Hello,

I want to change the fb meta tag in my own component to post open graph actions

it is always set as an 'article' in the source

Code:

it has to be 'table'

I can change this by javascript but it has to be done in php I suppose current/smile

can anyone help me with this issue?

thanks

moparlakci
useravatar
Offline
6 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

Yes, it would have to be done in PHP as Facebook's crawler doesn't execute Javascript and wouldn't see those modifications.

What you should do is:
* Install the Open Graph - Custom plugin
* Enable it in the Plugin manager
* Go to the Open Graph -> Objects area of JFBConnect
* Click "New", then click "Custom Object Type"
* Set the name to whatever you want
* Set the Object Type to whatever you want it to be
* Then, in the right for URL Query Parameters, simply put something like:

option=com_yourcomponent
view=blahblah

You can just set the option, or you can be as specific as you want by adding more parameters for each line.

Hope that helps get you going, but if you have more questions, just let us know.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Online
24023 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

Okay My Read actions are being published on facebook but my other action 'reserve' is not being published because I want this to be published when a custom component is accessed and a button is clicked. I have set up a new custom object

with url query parameters like this

option=com_mycomponent
view=reservation
layout=complete


and open graph tags like this

type=randomrandom:table


in the activity log

(#3502) Object at URL *****?view=reservation&layout=complete has og:type of 'place'. The property 'table' requires an object of og:type 'randomrandom:table'. (http response code: 206)

moparlakci
useravatar
Offline
6 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

Use the Facebook URL Debug Tool to check the page that isn't posting properly and see what data Facebook sees. It should tell you if there are multiple 'type' properties defined or if there is only one, and it's defined as 'place' instead of 'table', which you want.

From that, we should know how to proceed a little better. You may also want to disable any other 'objects' you have defined in JFBConnect to make sure they aren't accidentally being used for the page you want.

Let us know how that goes,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Online
24023 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

Hi thanks

I have changed some strategies current/smile

I have created an article 'A table' and put some text in it

Created a custom object in backend with these options
option=com_content
view=article
id=12

and opengraph
myown:table

And in my own component I have added a button with the javascript code - which I found in other threads - with the url pointing to this article.
got the ID of my action and the code looks like this

Code:


a class="btn btn-large" href="javascript:void(0)" onclick="jfbc.opengraph.triggerAction('1','http://www.example.com/table/');">
Click here to post the action to FB!
/a

for those who have problems with this code, you haven't probably enabled mootools, just put this above your code/template

Code:

JHtml::_('behavior.keepalive');

now when someone clicks on this button, it fires an action to Fb, thats great!

My question is How can I show this button to only Facebook users? is there a method or variable?

i can check a user if he is guest or not like this

Code:



if ($this->user->get('guest')):
    // The user is not logged in.

else:
    // The user is already logged in.
   
endif;

Im using joomla 3.0 and I have set Error Reporting to 'Development', so I see every little warning, and it gives me this warning

Code:

Strict Standards: Declaration of JFBConnectControllerOpenGraph::display() should be compatible with JControllerLegacy::display($cachable = false, $urlparams = Array) in /home/restoWeb/www/components/com_jfbconnect/controllers/opengraph.php on line 13

Okay I can hide this one, thats no problem current/smile


thanks alot

moparlakci
useravatar
Offline
6 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

Glad to hear you're making progress and getting your Custom Actions going.

To check if the user is logged in through Facebook, you can use the following code:

Code:

$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();

if ($jfbcLibrary->userIsConnected() )
{
  // Do something here
}

We're always looking for strict errors we have missed. We'll look into fixing that one in the next release, but it's something that can be safely hidden.

Hope that helps,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Online
24023 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

everything works fine now, but what does the error 'action not ready for this user' mean?

and how can I delete this css file
/components/com_jfbconnect/assets/jfbconnect.css

where is it being imported in the dom?
I couldn't find it

moparlakci
useravatar
Offline
6 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

The "Action not ready for this user" means that the action is being triggered too frequently. So, if you've configured the action to only occur once every day, for instance, and the user has already triggered that action, if the user tries to trigger the same action later that day, they'd see that message. Hope that explains, but if you need more information, let me know.

As for the jfbconnect.css file, that's only included in the /components/com_jfbconnect/views/opengraph/view.html.php file. It should only be included on our pages listing the user's actions in JFBConnect.

Best of luck,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Online
24023 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

okay i've found it it's being imported via the plugin

system/jfbcsystem/jfbcsystem.php

on line 449

I am using less css to generate my css files, thats why I needed to remove it

thanks

moparlakci
useravatar
Offline
6 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: object type in custom component

I'll have to look, I didn't realize it was in that file as well. Glad you got it going though. Should you need anything else, just let us know.

Thanks!
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Online
24023 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11616
Total Polls:
0
Total Posts:
48818
Posts today:
7
User Info
 
Total Users:
47667
Newest User:
jaiama
Members Online:
8
Guests Online:
1159

Social Stream
SourceCoast Joomla Social Extensions
Friday, 25 May 2018
JFBConnect 8.0 Coming Soon! Stay tuned.
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program