• Home
  • Get help
  • Ask a question
Last post 15 hours 58 min ago
Posts last week 81
Average response time last week 4 hours 29 min
All time posts 67914
All time tickets 10497
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#831 – sh404SEF does not set metas so that they can be reused by JFBConnect

Posted in ‘sh404SEF’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Sunday, 09 August 2015 16:29 UTC
altitudes
Hello

Could you please have a look at the issue I exposed here:
http://anything-digital.com/forum/extension/sh404sef/10981-sh404sef-does-not-set-metas-so-that-they-can-be-reused-by-jfbconnect.html

Nothing has changed from then... Any hope to get a fix in sh404SEF?

Thank you
Monday, 10 August 2015 12:55 UTC
wb_weeblr
Hi

Nope, there's not change here. The method I've been using since 2006 to inject meta data is most likely to stick. Why is JFB connect used for Open graph tags instead of sh404SEF?

Rgds
 
Wednesday, 12 August 2015 13:48 UTC
altitudes
Hello

Thank you for your answer. I don't use sh404SEF for Open Graph tags because JFBConnect has some additional features (automatically use article images as Open Graph images, define rules depending on article categories etc.).

Maybe the following option could be introduced in sh404SEF configuration:
[ ] Set page title and description so that it can be reused by other components

This is quite easy to achieve, I did it myself by adding the following code where needed in components\com_sh404sef\shPageRewrite.php (this was for an older version of sh404SEF, now this code should maybe be put elsewhere):
      $document = JFactory::getDocument();
      $document->setTitle($shPageInfo->pageTitle);
      $document->setDescription($shPageInfo->pageDescription);

Would you consider this?

Thanks
Thursday, 13 August 2015 08:31 UTC
wb_weeblr
Hi

Yes, I will. It's not that simple, though it'll work in many situation, but I understand there are situations where that's benefitial.

Rgds
 
Thursday, 13 August 2015 08:56 UTC
altitudes
Thank you very much :)
Thursday, 13 August 2015 10:37 UTC
wb_weeblr
Hi

If I were to provide you with a development version, would you be able to test it with JFBConnect? (on a test site)

Rgds
 
Thursday, 13 August 2015 12:19 UTC
altitudes
Yes, sure. And if you think of specific things I should test, tell me.
Thursday, 13 August 2015 16:48 UTC
wb_weeblr
Hi

Please download this development version from: https://copy.com/xxxx

What you want to look at specifically is probably:

- whether JFBConnect is happy and can collect title and description
- whether page titles and descriptions (and also possibly other meta data or canonical) operates normally: if you set them in the URL manager, you find them in the source of the corresponding page. Alternatively, if you set meta data through Joomla (not for com_content though), then you find the meta data in the page.

Auto selection of the image is a strange thing. It's something we actually already do (for the Pinterest buttons), so it's probably not hard to rework so it can be used in more than one lcoation. However, it also means more settings, etc
In addition, and most importantly, so far I have refrained to adding it because of the fact that if you have a large image on your article, FB will pick it up anyway. If you have multiple images, then the automatic selection cannot pick the right one anyway. So the value appears limited to me.

Thanks and regards

 
Friday, 14 August 2015 13:16 UTC
altitudes
Hello

All of my tests with various components went fine expect for title in com_content.

First, title defined in sh404SEF URL manager does not seem to be taken into account. Title of an article page (<title> tag) is always defined based on sh404SEF Configuration > Extensions > Joomla preferences. On a category page, title is always the same, whatever are those preferences.
Maybe this is normal, only you can tell ;)

Secondly, for article pages, JFBConnect does not reuse the title defined by sh404SEF. For category pages, it does correctly.

If ever you need to have access to my testing site, just tell me ;)
Monday, 17 August 2015 10:49 UTC
wb_weeblr
Hi

Thanks for your feedback. Can you clarify:

1 - First, title defined in sh404SEF URL manager does not seem to be taken into account.
Title of an article page (<title> tag) is always defined based on sh404SEF

I have found the problem for that, it was a change made for this new version, I had given the priority to automatically built meta over custom meta. I have uploaded a new version that should fix that (same URL)

2 - On a category page, title is always the same, whatever are those preferences.

Yes, there's no preference for category pages. They are low value pages, which most of the times are competing with the article pages, so there's not much effort to be spent on them.

3 - JFBConnect not reusing data

I was a bit puzzled by that, as sh404SEF is now fully compliant with Joomla API. So I searched all the test sites I have from users, to see if one was using JFBConnect and try understand. I found one running JFBConnect version 6.3.0, which may not be the latest, but I could reproduce exactly what you saw.

After installing my current version (the one I just uploaded for you), I could debug JFBConnect on my local machine and find out that:

1 - For this to work, the JFB system plugin must located AFTER the sh404SEF system plugin. I haven't seen any adverse effect to that so far but that needs to be tested more obviously

2 - The real problem is in JFBConnect. You see, I have been taking heat because sh404SEF was injecting meta data using a method that doesn't follow Joomla API, but it just happens that (at least in that 6.3.0 version), JFBConnect does not use the Joomla API either, and this is why it's not picking up the document title set by sh404SEF.

You can fix that in /plugins/opengraph/content/content.php, around line 115: replace

$this->addOpenGraphTag('title', $article->title, false);

with
$this->addOpenGraphTag('title', JFactory::getDocument()->getTitle(), false);


Note that these tests and fix only apply to viewing an article. If viewing a category, for some reason, JFB doesn't read and set the open graph title at all (?!)

Which leads to another thing: it looks like JFBConnect does not handle description properly either. It uses the following:
if ($desc_type == 'custom_desc_introwords')
                $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_WORDS);
            else if ($desc_type == 'custom_desc_introchars')
                $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_CHARS);
            $this->addOpenGraphTag('description', $desc, false);

Which means it will always use the beginning of the article as a description, simply disregarding any pre-existing description. So if you have set a description, either through Joomla! or sh404SEF, it won't be used.
I'm not familiar enough with JFB connect to know if there's an option for that though, can you confirm?

Cheers


 
Monday, 17 August 2015 10:58 UTC
wb_weeblr
I have tested a fix also for description:
in /plugins/opengraph/content/content.php, around line 117: replace
if ($desc_type == 'custom_desc_introwords')
			        $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_WORDS);
		        else if ($desc_type == 'custom_desc_introchars')
			        $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_CHARS);
$this->addOpenGraphTag('description', $desc, false);

with
$desc = JFactory::getDocument()->getDescription();
if(empty($desc))
	        {
		        if ($desc_type == 'custom_desc_introwords')
			        $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_WORDS);
		        else if ($desc_type == 'custom_desc_introchars')
			        $desc = $this->getFirstArticleText($article, $desc_length, SC_INTRO_CHARS);
	        }
            $this->addOpenGraphTag('description', $desc, false);

What this does is read first the description meta from the document (either from Joomla "Description" field or sh404SEF-created one or any other source actually). If none has been set, then it reverts to JFBConnect original code and build the description from the article content.

Rgds
 
Wednesday, 19 August 2015 15:50 UTC
altitudes
Hello

Sorry for the delay of my reply, I am a bit busy these days ;)

For 1 - and 2 - that's OK, everything is clear.

For 3 -
Regarding the system plugins order, my JFBConnect plugin has been after sh404SEF one from the start. Otherwise I suppose nothing would have worked in my tests ;)

Regarding your JFBConnect code modification suggestions, here is how I think JFBConnect works:

By default, JFBConnect uses the meta title and desc for setting OpenGraph tags.
Then, if an opengraph plugin exists for this component, the plugin may override these OpenGraph tags. This is the case for com_content:
- For the title, the Content opengraph plugin sets the OpenGraph title with the article title. Not very accurate I think, at least this should be configurable through the plugin options (as it is for the desc, see below).
- For the desc, find attached a snapshot of the plugin parameters (well in fact this is not exactly the plugin parameters, but rather the object parameters, go to JFBConnect > Open Graph > Objects and you will see). There, if you set Description Type = Intro Words or Characters, then the plugin sets the OpenGraph desc accordingly. If you set Description Type = Meta, then the plugin will do nothing as this is done by default.

So, considering your code modification suggestions, I thing the one for the desc is useless, and the one for the title could be replaced by just removing the plugin code setting the title.

I am not able to confirm all this by testing at the moment, but if you can... or I will a bit later ;)
Wednesday, 19 August 2015 16:08 UTC
altitudes
Just looked a bit further in the plugin code (content.php) and found:
      $desc = ''; //Note: meta is same as blank value, since system plugin attempts to generate from metadescription if no value is found

So when parameter is Type = Meta, plugin sets an empty OpenGraph desc, and what I called "default behavior" (setting the OpenGraph desc with meta) is triggered afterwards. At least this is my understanding ;)

Honestly, from my previous tests, I think the only issue we have is that Content opengraph plugin always sets the article OpenGraph title with Joomla article title. I have started a discussion with JFBConnect editor about this here.

Regards
Thursday, 20 August 2015 08:25 UTC
wb_weeblr
Hi

Let's concentrate on what the com_content plugin is doing, I haven't searched for the default code (if there's no plugin - If you know where that's done, I can have a look).

Also note that I'm doing all of this with 6.3.0. I wasn't able to update to current 6.4.1 (no licence) so this may have been fixed in between. From your own tests, it does look fixed.

1 -
- For the title, the Content opengraph plugin sets the OpenGraph title with the article title. Not very accurate I think, at least this should be configurable through the plugin options (as it is for the desc, see below).
It's not "not very accurate". It's wrong. JFB is reading the title directly from the database, and disregards any change to the page title that may have been done either by user or by other plugins.
The OGP tag must be set to the content of the page title, unless webmaster has manually decided to type a different one.

This may be fixed in current version, but in 6.3.0, if the user sets a "Browser page title" in Joomla menu item editor, JFBConnect will not pick it up and instead use the article title!

FYI, I also set the the parameter to "Meta" and the behavior is the same: actual page title is not picked up by JFB, it only uses the article title stored in the database. This behavior is consistent with the code I see.

2 -
So when parameter is Type = Meta, plugin sets an empty OpenGraph desc, and what I called "default behavior" (setting the OpenGraph desc with meta) is triggered afterwards. At least this is my understanding ;)
Description has the same problem as page title. When using "Type = meta", JFB indeed doesn't try to compute the desc based on 1st paragraph, it's supposed to use the page meta description.
I tested this scenario and the problem is the same: JFB doesn't pick the actual document description meta. It probably reads it from database, and don't use the actual document description. Same reason, it's probably not using $document->getDescription().

3 - Regarding thread you ulinked to, the last post reply should be more or less:

"sh404SEF has a develoment version that's compliant with Joomla API and sets page title and description according to it (ie not "at the last second"). Problem is: even if page title and description is output correctly, JFB doesn't pick them up because it seems to no be using the Joomla API for that. Using the code mentioned above:
$document = JFactory::getDocument();
$title = $document->getTitle();
$this->addOpenGraphTag('title', $title, false);

indeed fixes the problem - And the same should be done for description, which is not correctly picked up as well.

Rgds
 
Thursday, 20 August 2015 08:32 UTC
wb_weeblr
Hi

In addition, please not that with version 6.3.0 I use, the problem is not really related to sh404SEF. Even if you disable it, JFBConnect, set to "Type = meta" doesn't pick up page title set through Joomla menu editor.
It does pick up the description though, so this may already have been fixed.

Rgds
 
Thursday, 20 August 2015 09:05 UTC
altitudes
Hello

From my tests (JFBConnect 6.4.1), the issue (JFBConnect not using page title and meta desc) is only on article title now. Maybe some things have changed between 6.3.0 and 6.4.1.

I replied to the thread on JFBConnect by pasting you suggested reply and modifying it.

Thanks
Thursday, 20 August 2015 09:34 UTC
wb_weeblr
ok, let's wait then.

Rgds

 
Thursday, 20 August 2015 15:45 UTC
altitudes
Hello

Discussion with JFBConnect support is over.
They will see if they take into consideration my request having a "Title Type = Page Title / Article Title" option. In the mean time, the only solution for me is to modify the plugin code as you (and they ;) suggested:
$document = JFactory::getDocument();
$title = $document->getTitle();
$this->addOpenGraphTag('title', $title, false);

What do we do now? Do you want me to test your dev version of sh404SEF with the fix of the issue "title defined in sh404SEF URL manager does not seem to be taken into account"? (as finally this is the only issue we had on sh404SEF side)
Thursday, 20 August 2015 16:41 UTC
wb_weeblr
Hi

Well, I think we tested that already, right? that's what drove us to find the requirement for a patch to JFB Connect?

As far as I'm concerned, I those changes will make it to next release of sh404SEF (probably mid-september).

Please advise if otherwise.

Rgds
 
Thursday, 20 August 2015 19:37 UTC
altitudes
I had not tested the fix in the 2d version uploaded to copy.com, but now I have and it's OK.

So now I'll wait for the official mid-september release ;)

Thank you!
Monday, 24 August 2015 06:46 UTC
wb_weeblr
Hi

Thanks for testing. I need to test, or maybe add a setting for this, as it may break in other situations, now that the meta data is not "forced" onto the page any longer.

Closing this ticket now, feel free to open a new one as needed. If you do so, please mention this ticket number in the new one.

Rgds
 
Tuesday, 08 September 2015 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.