Where does "- Admin" suffix come from in the page titles for a subsite?

35 views
Skip to first unread message

paulj...@gmail.com

unread,
Nov 3, 2011, 9:24:49 PM11/3/11
to Hobo Users
I made a subsite that is not an admin subsite and I would like to
remove the "- Admin" that gets added to the main site name to make the
page titles for the subsite.

I have searched all through the app source but cannot find where it is
defined.

Thanks!

Matt Jones

unread,
Nov 3, 2011, 10:00:16 PM11/3/11
to hobo...@googlegroups.com

It's defined in Hobo::Helper (in lib/hobo/helper.rb in the gem). You should be able to redefine it in an initializer:

module Hobo
module Helper
def app_name(add_subsite=true)
# do something here
# the default app name is accessible as Rails.application.config.hobo.app_name
# the current subsite's name is available as subsite
end
end
end

--Matt Jones

paulj...@gmail.com

unread,
Nov 3, 2011, 10:58:29 PM11/3/11
to Hobo Users
Thanks.

I will do that and check out the source.

On Nov 3, 7:00 pm, Matt Jones <al2o...@gmail.com> wrote:

paulj...@gmail.com

unread,
Nov 4, 2011, 9:06:19 PM11/4/11
to Hobo Users
OK, I think I need a little more help on this.

I have tried this a few ways but can't seem to get it to change the
titling of the subsite.

I guess I have two questions:

1. In what file should I put the redefinition?

I have tried dryml_taglibs.rb and in application.rb (just above the
module <appname> line) but neither had an effect.

2. I am cool with writing the body of the method, but how does the
definition need to begin? Do I just need to jump in with:

def app_name(add_subsite=true)
...

or do I need to start with the location of the previous method
definition as you did, something like:

> > module Hobo
> >   module Helper
> >     def app_name(add_subsite=true)
>> ...


On Nov 3, 7:58 pm, "pauljda...@gmail.com" <pauljda...@gmail.com>
wrote:

paulj...@gmail.com

unread,
Nov 8, 2011, 5:41:59 PM11/8/11
to Hobo Users
I have done a little more on this.

I learned that all the files in /config/initializers get read, so I
created a new file in that directory, re-define_subsite_name.rb.

When I do it bare - just jumping in with:

def app_name(add_subsite=true)

... it has no effect.

When I add the prefix:

module Hobo
  module Helper
    def app_name(add_subsite=true)
...

(The whole file is at http://pastie.org/2833399)

I get an error at app load time. Passenger says:

[ pid=4588 thr=2151850560 file=utils.rb:176 time=2011-11-08
14:38:27.516 ]: *** Exception PhusionPassenger::UnknownError in
PhusionPassenger::Rack::ApplicationSpawner (undefined method
`add_to_controller' for Hobo::Helper:Module (NoMethodError)) (process
4588, thread #<Thread:0x00000100854480>):

Any ideas?

On Nov 4, 5:06 pm, "pauljda...@gmail.com" <pauljda...@gmail.com>
wrote:

paulj...@gmail.com

unread,
Nov 13, 2011, 12:23:26 AM11/13/11
to hobo...@googlegroups.com
Can I get another hand on this? I am hoping to present this to users next week and the - Admin suffix is just funny looking and appears all over the subsite where most users will spend most of their time.

Thanks so much!

Bryan Larsen

unread,
Nov 14, 2011, 8:44:19 AM11/14/11
to hobo...@googlegroups.com
Hmmm, I checked one of our apps, and I don't see the "- Admin" suffix
on the pages.

The only thing we've done is defined

<def tag="app-name">foo</def>

in admin_site.dryml

Bryan

> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/ZnIW10v0zk0J.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
>

paulj...@gmail.com

unread,
Nov 14, 2011, 7:37:17 PM11/14/11
to hobo...@googlegroups.com
Thanks! I just did that and it had exactly the effect I was hoping for.

Thanks a lot, Bryan!
Reply all
Reply to author
Forward
0 new messages