diff --git a/app/models/site_feed_annc.rb b/app/models/site_feed_annc.rb index 5ab1de8..0d07367 100644 --- a/app/models/site_feed_annc.rb +++ b/app/models/site_feed_annc.rb @@ -15,7 +15,7 @@ class SiteFeedAnnc def get_annc(annc_uid) Array(self[:all_contents_for_feed]).select{|v| v['id']==annc_uid}[0] rescue {} end - def all_contents_for_feed(site_source=nil,locale=I18n.locale.to_s) + def all_contents_for_feed(site_source=nil,locale=I18n.locale.to_s,is_widget=false) cat = self.category_title Array(self[:all_contents_for_feed]).collect do |v| tmp = v @@ -57,7 +57,11 @@ class SiteFeedAnnc tmp["subtitle"] = tmp["subtitle_translations"][locale] tmp["source-site-link"] = tmp["source-site"] tmp["source-site"] = "#{tmp["source-site-title"]}" - tmp["link_to_show"] = OrbitHelper.url_to_show(tmp["params"]) rescue '' + if !is_widget + tmp["link_to_show"] = OrbitHelper.url_to_show(tmp["params"]) rescue '' + else + tmp["link_to_show"] = OrbitHelper.widget_item_url(tmp["params"]) rescue '' + end tmp["target"] = "_self" tmp["img_src"] = tmp["image"]["thumb"] || "/assets/announcement-default.jpg" tmp["img_description"] = tmp["image_description_translations"][locale]