Method: CmsApplicationHelper#breadcrumbs

Defined in:
app/helpers/cms_application_helper.rb


572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'app/helpers/cms_application_helper.rb', line 572

def breadcrumbs(options = {})
  # only works on CCS pages
  if @pg
    separator = options.delete(:separator) || ' » '
    link_class = options.delete(:link_class)
    
    pg = @pg
    ret = pg.title
    
    while pg = pg.parent
      if pg.published_version >= 0
        ret = "<a href=\"/#{pg.path}\" class=\"#{link_class}\">#{pg.title}</a>" + separator + ret
      end
    end
    
    return ret
  else
    return ''
  end
end