From d0732cbc57d21794bb08c5e373aac328d84ffe81 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 25 Feb 2015 17:00:43 +0100 Subject: [PATCH] gallery og tag --- app/views/galleries/show.html.erb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/views/galleries/show.html.erb b/app/views/galleries/show.html.erb index 1725938..db0598d 100644 --- a/app/views/galleries/show.html.erb +++ b/app/views/galleries/show.html.erb @@ -1,5 +1,35 @@ <%= content_for :header do %> Fet - Fotos: <%= @gallery.name %> + +<% +if @openfotoid.nil? || @openfotoid==0 + @firstfoto= @fotos_p.first + picture_url=URI(root_url) + picture_url.path=@firstfoto.datei.url(:locale=>nil, :theme=>nil) +set_meta_tags :og => { +:image => picture_url.to_s, +:title => @gallery.name.to_s, +:type => "article", +:url=>gallery_url(@gallery,:theme=>nil) +} +else +@ofoto=Foto.find(@openfotoid) +picture_url=URI(root_url) +picture_url.path=@ofoto.datei.url(:locale=>nil, :theme=>nil) +set_meta_tags :og => { +:image => picture_url.to_s, +:title => @gallery.name.to_s, +:type => "article", +:url=>gallery_foto_url(@gallery,@ofoto,:theme=>nil) +} + + +end +%> + + + + <% end %>