
Customization of tag links
Reported by Akzhan | October 1st, 2009 @ 10:40 AM
We need customization of links to tags (to easy adopt themes for AdvaCMS).
So here is our proposal to update
- app/helpers/content_helper.rb
def link_to_tag(*args)
options = args.extract_options!
tag = args.pop
section = args.pop
route_name = :"#{section.class.name.downcase}_tag_path"
text = args.pop || tag.name
link_to(text, send(route_name, :section_id => section.id, :tags => tag), options)
end
And second proposal is tag cloud cell (typical for social networks):
- app/cells/tag_cloud_cell.rb
class TagCloudCell < BaseCell
has_state :index
helper :content
def index
symbolize_options!
set_site
set_section
nil
end
end
- app/cells/tag_cloud/index.html.erb
<% if @section and @section.tag_counts.present? %>
<h2>Tags:</h2>
<div class="tags">
<% @section.tag_counts.each do |tag|
weight = tag.count / 10
weight = 5 if weight > 5
weight = 1 if weight < 1
%>
<%= link_to_tag @section, tag, :class => "s#{weight}" %>
<% end %>
</div>
<% end %>
We use RSpec instead of test unit so I do not send test cases.
Comments and changes to this ticket
-
Clemens Kofler October 30th, 2009 @ 10:23 AM
Hi Akzhan,
sorry for getting back to you a bit late.
I don't see a problem with the first proposal. If you can send a patch including a test, that would be awesome. As you say, we use Test::Unit, so please do use that instead of RSpec.
As for the second proposal, I'd suggest that people just write their own tag cloud if they need it or use one of the gazillion plugins.
-
Marko Seppä November 23rd, 2009 @ 11:38 AM
- State changed from new to open
-
Julia Ann March 19th, 2021 @ 08:36 AM
Golo Promo Code
Golo team of doctors, researchers, pharmacists and formulators have spent over 9 years developing Release, an all-natural plant-based nutraceutical designed to balance hormones, increase metabolic efficiency, help combat Insulin Resistance and metabolic dysfunction.
https://couponsagent.com/front/store-profile/golo-coupons -
Juanita Murdock August 23rd, 2022 @ 02:47 PM
Here is the solution available for the various people that would work to all. I’m sure after the customization of those links we able to promote the skills. Thumbs up with your recommendation sharing on https://spacecoastdaily.com/2022/03/top-3-genius-essay-writing-serv... these are quite updated and helping.
-
ulive chat September 24th, 2022 @ 06:19 AM
Excellent read. I just passed this onto a colleague who was doing some research on that. He actually bought me lunch as I found it for him! Therefore let me rephrase: ulive.chat
-
Jeremiah Hall October 4th, 2022 @ 01:46 PM
Art work design is opened for the stylish ambit for the shows. All the issues of the Workshop supplies
are implied for the field. Official look is ensured for the grounded tip and mode for the things for the citizens. -
bettycooper October 31st, 2022 @ 10:19 AM
Playing entertaining io games with friends is the most enticing approach to pass the time. Take advantage of the opportunity to talk to and play IO games with new players.
-
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>
<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>
<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>