[typo] titles for tagged pages

Ernie Oporto ernieoporto at gmail.com
Sun Apr 2 00:23:24 EST 2006


I found this in app/controllers/articles_controller.rb as the only mention
of @page_title or tags.

  def tag
    render_grouping(Tag)
  end
  def view_page
    if(@page = Page.find_by_name(params[:name].to_a.join('/')))
      @page_title = @page.title
    else
      render :nothing => true, :status => 404
    end
  end

and setting the @page_title line to
         @page_title = @page.title + " - #{tag.display_name}"
doesn't produce anything when the URL is
    http://www.website.com/blog/articles/tag/blah

The text I'm trying to add to the title is dynamic based on the tag if the
path includes "articles/tag", so it's not a predefined text I'm setting.  In
fact it should probably work that way for categories, too.

I'll keep digging to see how this all works with articles_controller.rb
Complete newb here, if you haven't noticed. =)



On 4/1/06, Kevin Ballard <kevin at sb.org> wrote:
>
> You might try doing exactly what Trejkaz suggested. In app/
> controllers/articles_controller.rb, look for the method you want to
> override the title for and set @page_title there.
>
> On Apr 1, 2006, at 7:11 PM, Ernie Oporto wrote:
>
> > I found this in app/helpers/articles_helper.rb
> >
> > def page_title
> >     if @page_title
> >       @page_title
> >     else
> >       this_blog.blog_name || "Typo"
> >     end
> > end
> >
> > I'm trying to add something like
> >     + " - #{tag.display_name}"
> > somewhere but I can't seem to find where and how.
> >
> >
> > On 4/1/06, Trejkaz <trejkaz at trypticon.org> wrote:On Sunday 02 April
> > 2006 05:05, Ernie Oporto wrote:
> > > This is probably a quickie.  I'd like to see pages that are tag
> > links, such
> > > as http://www.website.com/blog/articles/tag/blah have a title of "
> > > Website.com - Blah", where currently the title is only set to
> > > "Website.com". How can I set that?
> >
> > Inside the tag method of articles_controller.rb, you probably want
> > to assign
> > @page_title to the title you want.
>
> --
> Kevin Ballard
> kevin at sb.org
> http://kevin.sb.org
> http://www.tildesoft.com
>
>
>
>
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list
>
>
>


--
Ernie
http://www.shokk.com/blog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20060402/dc012cda/attachment.htm 


More information about the Typo-list mailing list