From 64bf4a1f48bfd098b088ca8281f65f0d1b1285f9 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 1 Jun 2012 17:31:34 -0700 Subject: [PATCH] adding the ability to customize your open graph namespace --- app/helpers/open_graph_helper.rb | 8 ++++++-- config/application.yml.example | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/helpers/open_graph_helper.rb b/app/helpers/open_graph_helper.rb index 26f8bb461..f9e3f3b1d 100644 --- a/app/helpers/open_graph_helper.rb +++ b/app/helpers/open_graph_helper.rb @@ -26,8 +26,12 @@ module OpenGraphHelper end def og_type - # the diaspora og namespace was already taken :( - meta_tag_with_property('og:type', 'joindiaspora:post') + meta_tag_with_property('og:type', og_namespace('frame')) + end + + def og_namespace(object) + namespace = AppConfig[:open_graph_namespace].present? ? AppConfig[:open_graph_namespace] : 'joindiaspora' + "#{namespace}:frame" end def og_page_specific_tags(post) diff --git a/config/application.yml.example b/config/application.yml.example index 569e3e87c..ae9a7ecb2 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -200,6 +200,9 @@ defaults: &defaults facebook_app_id: '' facebook_app_secret: '' + #this will be the namespace for your object, it should be configured in your FB app + open_graph_namespace: '' + ## OAuth credentials for Twitter: twitter_consumer_key: ''