Ok, when you create a theme for the MM, I would like to know
What is the code to install the line, example from the carserve theme
Is this code generated by the Trongate app or by the creator of the Theme?
MM theme install
4 years ago
4 years ago
#1
4 years ago
#2
I think the concise answer to your question is: when you've built a working theme, all you need is a .zip file of the new theme folder in public/themes. No additional code is required to get the TG Desktop App to install the theme. It's all done for you.
The Trongate DA uses the name of the theme's .zip file to add in all the extra code necessary to make it work.
----------
If you're creating a theme then all you'll need in your .zip file is the named theme folder. So lets say you've created a theme called 'groovytheme':
In your Trongate app you'll make a folder in your public/themes/groovytheme folder when you create your new theme to test it.
In that 'groovytheme' folder, you'll have a folder called 'default', and in that will be all your themes files, like a css folder, a js folder etc.
Make sure to include a file (in the 'default' folder root) with the same name as your theme e.g. groovytheme.php
Make a .zip of the entire groovytheme folder (found in public/themes). That's what you'll upload when you add your theme to the Module Marketplace.
Now, when ever your theme is installed using the Trongate Desktop App, it will copy the folder in your .zip to the public/themes of their app, then it will automagically update all the necessary files to make it a functional theme in Trongate.
If you download the theme directly from the Module Market, you need to:
1. Unzip the folder into the public/themes folder of your app
2. Edit your config/themes.php file and add the following:
3. Edit your templates/controllers/Templates.php file and add the following:
4. Edit your module to use the new theme as follows (I've used the welcome module as an example):
Inside the index() method, comment the default line of code and replace it with this code:
The Trongate DA uses the name of the theme's .zip file to add in all the extra code necessary to make it work.
----------
If you're creating a theme then all you'll need in your .zip file is the named theme folder. So lets say you've created a theme called 'groovytheme':
In your Trongate app you'll make a folder in your public/themes/groovytheme folder when you create your new theme to test it.
In that 'groovytheme' folder, you'll have a folder called 'default', and in that will be all your themes files, like a css folder, a js folder etc.
Make sure to include a file (in the 'default' folder root) with the same name as your theme e.g. groovytheme.php
Make a .zip of the entire groovytheme folder (found in public/themes). That's what you'll upload when you add your theme to the Module Marketplace.
Now, when ever your theme is installed using the Trongate Desktop App, it will copy the folder in your .zip to the public/themes of their app, then it will automagically update all the necessary files to make it a functional theme in Trongate.
If you download the theme directly from the Module Market, you need to:
1. Unzip the folder into the public/themes folder of your app
2. Edit your config/themes.php file and add the following:
3. Edit your templates/controllers/Templates.php file and add the following:
4. Edit your module to use the new theme as follows (I've used the welcome module as an example):
Inside the index() method, comment the default line of code and replace it with this code:
4 years ago
#3
Thanks for the very descriptive response.
However, my question is much more simple.
I was just wondering how the code was installed when you get the theme from the MM through the Trongate App.
How does the Trongate app know it is a theme?
Does the Trongate app add the lines of code or the theme creator?
Thanks, Dan
However, my question is much more simple.
I was just wondering how the code was installed when you get the theme from the MM through the Trongate App.
How does the Trongate app know it is a theme?
Does the Trongate app add the lines of code or the theme creator?
Thanks, Dan
4 years ago
#4
Ah OK. I'm fairly sure it's the TG Desktop App that adds in the code. Not sure how as it an Electron app IIRC.
4 years ago
#5
Nice post Gav on the detail of a theme setup in Trongate and you are right about the desktop app doing the magic when you install a theme from the TMM.
Here is the code that does the config:
Here is the code that does the config:
4 years ago
#6
Thanks Simon. Yes that looks about right from what I've seen. Is that the language Electron uses? It seems very similar to PHP.
4 years ago
#7
Hi Gavin,
That's JavaScript, where Electron combines the Chromium rendering engine and the Node.js runtime
That's JavaScript, where Electron combines the Chromium rendering engine and the Node.js runtime
4 years ago
#8
What would be very cool, is if a MM theme .zip import could have modules, so that a theme with multiple pages could be made fully functional right from installation. Say, if the theme .zip contained a modules folder in the root, then any folders within that could be copied into the users app modules folder.
4 years ago
#9
Gavin, Yes that would be cool.
Also, I am wondering what a complete website would look like, Modules, Sub-modules, complete database tables.
Dan
Also, I am wondering what a complete website would look like, Modules, Sub-modules, complete database tables.
Dan
4 years ago
#10
Yes, me too but I think David has more or less decided to remove the full website type module in favour of a 'games' category.