Mohit Sindhwani wrote:
Mohit Sindhwani wrote:
tag "aggregate_snippet" do |tag|
raise "`snippet_name' attribute required" unless
tag.attr["snippet_name"]
if name = tag.attr['snippet_name']
if snippet = Snippet.find_by_name(name.strip) #snippet was found..
urls =
snippet.content.split(";").map(&:strip).reject(&:blank?).map { |u|
clean_url u }
parent_ids = urls.map {|u| Page.find_by_url(u) }.map(&:id)
tag.locals.parent_ids = parent_ids
tag.expand
end
In the lines above,
if snippet = Snippet.find_by_name(name.strip) #snippet was found..
should be:
if snippet = Snippet.find_by_name(snippet_name.strip) #snippet was
found..
sorry for flooding... I just noticed that line is correct but the code
is missing a couple of 'end' statements. How about you treat it as
pseudocode :P
Cheers,
Mohit.
5/27/2009 | 1:05 AM.
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant