Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !1663

Closed
Created Oct 09, 2012 by Administrator@rootOwner
  • Report abuse
Report abuse

Allow custom page title and logo

  • Overview 4
  • Commits 6
  • Changes 12

Created by: rspeicher

Two points of customization:

First, a user can override any of the app's CSS by editing app/assets/stylesheets/overrides.scss. The file was checked into Git and then ignored, so any customizations won't be wiped out by future updates upstream. This takes care of changing the logo.

Second, I added two helper methods, page_title and application_title that can be customized with an initializer (below), which we can document in the Wiki for people who want to do that.

module MyCustomApplicationHelper
  def custom_application_title
    content_tag(:h1, "Startup, Inc.")
  end

  def custom_page_title
    title = "Startup, Inc."
    title += " > #{@project.name}" if @project && @project.persisted?
    title
  end
end

Rails.application.config.after_initialize do
  ActionView::Base.send(:include, MyCustomApplicationHelper)
end

My goal with this was that if you didn't need to customize anything, it was invisible to you. So nothing in the Admin area about uploading a logo or the like.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/rspeicher/custom_logo