Skip to content
Browse files

Added options for showing bookmarks

  • Loading branch information...
1 parent 951f197 commit 93f7c28fd057c8672408b301c206282c0a153e09 @EnriqueVidal committed Jun 17, 2010
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/sexy_bookmarks_macros_helper.rb
View
15 lib/sexy_bookmarks_macros_helper.rb
@@ -10,13 +10,20 @@ def available_social_networks
@available_socials
end
- def show_sexy_bookmarks( socials = nil, per_row = 8 )
- socials = available_social_networks.keys if socials.nil?
- social_items = Array.new
+ def show_sexy_bookmarks( content, socials = nil, per_row = 8 )
+ socials = available_social_networks.keys if socials.nil?
list_items = socials.collect do |social|
+
+ link_url = available_social_networks[social.to_s]['url'].to_s.gsub( /SHORT_TITLE|TITLE/, content[:title].to_s )
+ link_url = link_url.gsub( /FETCH_URL|PERMALINK/, content[:permalink].to_s )
+ link_url = link_url.gsub( /POST_SUMMARY|SEXY_TEASER/, content[:post_summary].to_s ).gsub(/SITE_NAME/, content[:site_name].to_s )
+ link_url = link_url.gsub( /TWITT_CAT/, content[:twitt_cat].to_s ).gsub( /DEFAULT_TAGS/, content[:default_tags].to_s )
+ link_url = link_url.gsub( /YAHOOTEASER/, content[:yahooteaser].to_s ).gsub( /YAHOOCATEGORY/, content[:yahoocategory].to_s )
+ link_url = link_url.gsub( /YAHOOMEDIATYPE/, content[:yahoomediatype].to_s )
+
link_options = {
- :href => available_social_networks[social.to_s]['url'],
+ :href => link_url,
:rel => :nofollow,
:title => available_social_networks[social.to_s]['message'],
:class => :external

0 comments on commit 93f7c28

Please sign in to comment.
Something went wrong with that request. Please try again.