This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="gallery"> | |
<a title="Sample Caption Text" href="/lightbox_gallery/gallery-photos/1.jpg"> | |
<img src="/lightbox_gallery/gallery-photos/1.jpg" height="80" width="120" /> | |
</a> | |
<a title="Sample Caption Text" href="/lightbox_gallery/gallery-photos/2.jpg"> | |
<img src="/lightbox_gallery/gallery-photos/2.jpg" height="80" width="120" /> | |
</a> | |
<a title="Sample Caption Text" href="/lightbox_gallery/gallery-photos/3.jpg"> | |
<img src="/lightbox_gallery/gallery-photos/3.jpg" height="80" width="120" /> | |
</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[slasticarnica (master)]$ rake routes | |
refinery / Refinery::Core::Engine | |
edmond /edmond(.:format) refinery/pages#edmond | |
Routes for Refinery::Core::Engine: | |
/system/resources/*dragonfly(.:format) <Dragonfly::App name=:refinery_resources > | |
insert_admin_resources GET /refinery/resources/insert(.:format) refinery/admin/resources#insert | |
admin_resources GET /refinery/resources(.:format) refinery/admin/resources#index | |
POST /refinery/resources(.:format) refinery/admin/resources#create | |
new_admin_resource GET /refinery/resources/new(.:format) refinery/admin/resources#new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this code in show.html.erb... | |
<% @page.children.each do |child| %> | |
<%= link_to(child) do %> | |
<%= image_tag @page.key_image.url if @page.key_image.present? %> | |
<h2><%= child.title %></h2> | |
<% end %> | |
<% end %> | |
is producing this output without images: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Objective: Display "hello world" in "U ponudi" page. (page "u ponudi" is created in backend in Pages tab) | |
Obstacle: When I overrode pages/show.html.erb file and modified it so that it displays "Hello World" on body_content_left, I don't get "Hello World" on my screen. I just get the content that i placed before in backedn. | |
This is the FIRST thing I tried. It's not working: | |
<% if @page.title == 'U ponudi' %> | |
<% content_for :body_content_left do %> | |
<h1>Hello World!</h1> | |
<% end %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is the script I included right after the <body> section (generated by facebook): | |
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=MY_APP_ID"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta charset='<%= Rails.application.config.encoding %>' /> | |
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]--> | |
<title><%= browser_title(yield(:title)) %></title> | |
<%= raw(%(<meta name="description" content="#{@meta.meta_description}" />)) if @meta.meta_description.present? -%> | |
<%= raw(%(<meta name="keywords" content="#{@meta.meta_keywords}">)) if @meta.meta_keywords.present? -%> | |
<%= raw(%(<link rel="canonical" content="#{@canonical}" />)) if @canonical.present? -%> | |
<%= csrf_meta_tags if Refinery::Core.authenticity_token_on_frontend -%> | |
<%= yield :meta %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the code included in <head> section: | |
<% require 'nokogiri' %> | |
<% frag = Nokogiri::HTML.fragment( 'hello world' ) %> (actually here suppose to go @post.body.html_safe) | |
<% first_img_src = frag.at_css('img')['src'] %> | |
<% first_p_text = frag.at_css('p').text %> | |
<meta property="og:title" content="Ovdje ide naslov" /> | |
<meta property="og:type" content="sport" /> | |
<meta property="og:url" content="http://kbk-siroki.herokuapp.com" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- path: app/views/refinery/admin/pages/_actions.html.erb --> | |
<!-- | |
You could override this view, if you want to add links to each page type via the admin UI. If you don't you'll have to add a param the the URL. | |
WARNING: You most probably want to do it cleaner than that and find a way to hook to this view instead of overriding it if at all possible. | |
--> | |
<ul> | |
<li> | |
<%= render '/refinery/admin/search', :url => refinery.admin_pages_path %> | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.rb: | |
... | |
match '/kontakt-page' => 'pages#bidon' | |
... | |
pages_controller.rb: | |
... | |
def bidon | |
render_with_templates? | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="link-news" href="#"> | |
<figure class="img-indent"><%= image_tag("page1-img1.jpg") %></figure> | |
<div class="extra-wrap"> | |
<time class="tdate-1" datetime="2012-10-21"> | |
<%= post.published_at.strftime('%d, %m, %Y') %> | |
</time> | |
<span><%= post.title %></span> | |
</div> | |
</a> |