Wednesday, February 15, 2017

How to change RefineryCMS refinery-cms-logo.svg to custom logo (RoR)

I have been searching around the web for quite a bit to find out how I can change the RefineryCMS logo to a custom one. I have volunteered to build a web page for a non-profit organization, and I am also interested to learn Ruby on Rails, so the best way is to embark on a project. This is so that I can get into the thick of it and pick up the skills.

Once RefineryCMS is running it looks like the following picture, the encircled logo belongs to the rails cms.
I have asked around in the NZ Christchurch ruby slack community, they refereed me to a stack overflow post Adding logo to RefineryCMS nav. I am new to ruby so the answers given in the post do not make sense as I cant find the mentioned file.

But one of the members in NZ Christchurch ruby slack community actually refer to the RefineryCMS documentation about overriding RefineryCms gem pages. Once I get my head around what that means the stack overflow post start to make sense.

This is what I have done with my new understanding.

1) cd into my refineryCMS rails directory

2) execute the following command in the project directory
        rake refinery:override view=refinery/*
once the above command is executed you will see the following output being printed in the console.

3) Now if you refresh your project you will see the following files being created.

4) site_bar.html.erb is the file you will be after. The content of the file looks like the following, we will be changing the image_tag
   
5) Copy your company or organization's logo into the following path, in my example I intend to display the byars-logo.ico


6)  Now modify the previous _site_bar file to the following.
7)  Refresh your refinery page, now you see that the logo has been changed, not looking perfect I agree I will do more modification to it until it looks nice

Thats all for now till next time.



No comments:

Post a Comment