Extension talk:OpenGraphMeta
Contents
Thread title | Replies | Last modified |
---|---|---|
Incorrect Namespace | 1 | 14:20, 20 April 2012 |
Suggestion: Change home page default title | 1 | 01:03, 14 February 2012 |
Bug or User Error? | 1 | 10:41, 10 January 2012 |
Mediawiki version required? | 2 | 10:40, 10 January 2012 |
Installed the extension but when I tried it on a page I changed this code:
((File:Prague.jpg|right|border|thumb|400px|Prague Old Town))
to this:
((File:{{#setmainimage:Prague.jpg}}|right|border|thumb|400px|Prague Old Town))
(Square brackets changed to round brackets for clarity.)
This throws an error:
RepoGroup::findFile recieved an Title object with incorrect namespace Backtrace:
- 0 /home/XXX/public_html/includes/GlobalFunctions.php(3235): RepoGroup->findFile(Object(Title), Array)
- 1 /home/XXX/public_html/extensions/OpenGraphMeta/OpenGraphMeta.php(58): wfFindFile(Object(Title))
- 2 [internal function]: efSetMainImagePH(Object(OutputPage), Object(ParserOutput), Array)
- 3 /home/XXX/public_html/includes/OutputPage.php(1190): call_user_func('efSetMainImageP...', Object(OutputPage), Object(ParserOutput), Array)
- 4 /home/XXX/public_html/includes/OutputPage.php(1203): OutputPage->addParserOutputNoText(Object(ParserOutput))
- 5 /home/XXX/public_html/includes/Article.php(4392): OutputPage->addParserOutput(Object(ParserOutput))
- 6 /home/XXX/public_html/includes/Article.php(1490): Article->outputWikiText('[[File:{{#setma...', true, Object(ParserOptions))
- 7 /home/XXX/public_html/includes/Article.php(4636): Article->doViewParse()
- 8 /home/XXX/public_html/includes/PoolCounter.php(151): PoolWorkArticleView->doWork()
- 9 /home/XXX/public_html/includes/Article.php(1011): PoolCounterWork->execute()
- 10 /home/XXX/public_html/includes/Wiki.php(462): Article->view()
- 11 /home/XXX/public_html/includes/Wiki.php(69): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
- 12 /home/XXX/public_html/index.php(114): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
- 13 {main}
Can anyone help?
PS Using MediaWiki 1.17.0 PHP 5.2.12 (apache) MySQL 5.0.95-community
Hello,
This opengraph extension gives the homepage of the wiki the title 'Main Page'. However it might be better to use the site name for this one particular page. It looks better on Facebook this way, and as 'Main page' is a default string, using the site name instead would actually make more sense (to me).
Kevin, Enideo
Implemented that in r111438.
This didn't seem to output the correct format for the OG meta tags due to the addMeta function called with the BeforePageDisplay hook. Could be my fault. For example, I am getting <meta name="property:og:type" content="article" />
when it should be <meta property="og:type" content="article"/>
. Unless there's something I'm missing, addMeta will only return <meta name="$value1" content="$value2"/>
formatted meta tags.
I am on MediaWiki 1.18.0, PHP 5.2.17, and MySQL 5.1.56--maybe the function addMeta has changed in the latest update? I corrected it by using the hook OutputPageBeforeHTML and the function addHeadItem to output:
foreach( $meta as $property => $value ) {
if ( $value ){
$out->addHeadItem( "OGMeta$i", '<meta property="'.$property.'" content="'.$value.'"/>'.PHP_EOL );
$i++;
}
It seems to work. Thoughts?
Try the trunk or 1.17 version of the extension. The 1.18 version seams to contain a change made after the 1.17 branch but was reverted later on.
Hi all, I have just tested this extension on a 1.15.4 MediaWiki installation and I had an error reporting:
Call to undefined method OutputPage::getTitle() in C:\server\xampplite\htdocs\wiki\extensions\OpenGraphMeta\OpenGraphMeta.php on line 65
Installation data:
- MW 1.15.4
- PHP 5.3.0
- MySQL 5.1.41
Extensions installed:
- MultipleUpload 1.0
- Cite r.37577
- DSADate 1.0
- DynamicPageList2 1.7.4
- ImageMap r.35980
- ImageSizeInfoFunctions 1.0.1
- MultipleUploadToolboxItem 0.1
- ParserFunctins 1.1.1
- PropertyTable2 1.2.1
- StringFunctions 2.0.1
- SyntaxHighlight
- GoogleTranslator 0.1
- NewUserEmailNotification 1.5.1
Moreover, inspecting the code, it seems that the extension Description2 is required for properly description tag be evaluated. Is my assumption correct? TIA
Yes, Description2 has the parsing code to extract a description from the page so OpenGraphMeta uses it instead of duplicating code.
OutputPage::getTitle was added in 1.16; 1.15 is not a supported MediaWiki version anymore, it's no longer receiving security updates and some security holes have been fixed in later versions of MediaWiki. So I see no reason to add 1.15 compat.