Cloning the Fordson Theme - Roll your own theme!

Cloning the Fordson Theme - Roll your own theme!

by Chris Kenniburg -
Number of replies: 12
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello All,

I get asked from time to time about cloning Fordson.  Maybe you want to build  you own theme and use Fordson as a starting point or maybe you want a different look for certain parts of your site and want to maintain 2 versions of Fordson and just change colors or logos.  

Well, you are in luck!  I have a very quick 10 minute video on how to do this.  I haven't fully vetted it beyond making sure it installs and loads nicely.  


***NOTE***

One step I discovered after making this video is that I failed to run this find and replace:

Find and Replace in all files:
/theme/fordson/
with
/theme/fordson2/

Average of ratings: Useful (5)
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Marini Marini -
Thank you Chris!!!
Great and clear explanation!
Wonderful
I was missing the step of modifying the file fordson_lib.php
Now is working ok!!!
sorry for putting the consultation in the wrong place
Again, thank you very much Chris!!
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Álvaro Martín Sancho -
Wonderful Tutorial.
I succeed following it but with the klass theme and it seems to work perfectly.
Thank you!
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Peter Nicholls -

Hi Chris, thanks for the video. I just need Fordson2 for my second course. Might it be possible for you to make available a zip file of the theme you've already cloned to save me a bit of time and possible pain?

Thanks so much if poss.

Peter

In reply to Peter Nicholls

Re: Cloning the Fordson Theme - Roll your own theme!

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
It is not possible. You will want this to be an exact copy of what you already have. I might not have the same version. We only test on latest.
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Peter Nicholls -
OK. Good of you to reply. I understand and will have a go at my own clone!
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Peter Nicholls -

Hi again. Had good success with cloning via Chris's video, notes above and one other tweak to deal with an error thrown when installing the zip file to Moodle.

However (there's usually one!), I get a curious interaction between Fordson and Fordson2 when setting the latter up.

So, I install an image (call it imageA) in Fordson > Custom image settings > Default header image. This shows fine on the course with which I'm using Fordson.

I install a different image (call it imageB) in Fordson2 to use with a different course and it won't show. But if I put imageA into Fordson2> … >Default header image, it will show in the Fordson2 course. So I don;t think it's an image problem.

Not least because if I install imageB in both Fordson and Fordson2, it will show in courses which use F and F2 respectively.

But I'm not able to get different images showing in different courses - which is the whole point of cloning the theme in the first place!

I've had a look at headerdefaultimage in the code for Fordson2 and I can't see anything obviously the matter (such as fordson rather than fordson2 being linked to it).

Any ideas for resolving this or what to look for would be much appreciated. I'm not a php coder so need all the help I can get.

In reply to Peter Nicholls

Re: Cloning the Fordson Theme - Roll your own theme!

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
You have made a mistake somewhere, probably in the setting name or the serving lib.php. You'll need to learn a bit of PHP to gain the skills required to debug your cloned copy and find the mistake, i.e. understand the syntax of the language.
In reply to Peter Nicholls

Re: Cloning the Fordson Theme - Roll your own theme!

by Silvan Said -
Hello Peter, I am having exactly the same issue as you. Did you manage to figure it out?
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Tanja Böhnke -

hello, 

I am very new to moodle and far away of building my own theme. However, I would like to know if there is a possibility to "transfer" the different Fordson coursetilestyles to another theme like Adaptable. I really like the appearance of the Tile Style two and that it shows the custom course field contents. 

Thank you very much, 

Tanja

In reply to Tanja Böhnke

Re: Cloning the Fordson Theme - Roll your own theme!

by Tanja Böhnke -
hello everyone. I decided to stay with Fordson and customize it to my needs.

Now I like to change the colour of the Category content in the course list (Tile Style 2). I found a code for the Raw SCSS field, which is working fine, but this works only for a single tile:

.container-fluid:nth-child(3) > .row:nth-child(1) > .col-md-4:nth-child(1) > .tilecontainer:nth-child(1) > .coursestyle2:nth-child(1) > .class-box-courseview:nth-child(1) > .coursevisible:nth-child(1) > figcaption:nth-child(1) > .course-card:nth-child(2) > .coursecat:nth-child(1) > a:nth-child(1) {
color: #b36f29;
}

How do I have to change this code to replace the font color in all tiles at once? Is there a possibility?

Thank you
In reply to Tanja Böhnke

Re: Cloning the Fordson Theme - Roll your own theme!

by Tanja Böhnke -
I think I found a solution myself:

I changed .container-fluid:nth-child(3) the 3 into n

I changed .col-md-4:nth-child(1) the 1 into n

with this changes the colors in all tiles are changed now.
In reply to Chris Kenniburg

Re: Cloning the Fordson Theme - Roll your own theme!

by Lea Cohen -
Thank you Chris, for this great video.

Question:
I see that you say to replace theme_fordson with theme_fordson2, and theme/fordson/ with theme/fordson2.
What about all the other instances of the word fordson in the code? such as
$theme = theme_config::load('fordson');
don't they have to be replaced with fordson2?