Theme-info.xml: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
No edit summary
 
(16 intermediate revisions by 7 users not shown)
Line 1: Line 1:
When you create a theme, you can decide to package your theme in order to upload it to the SMF Theme Site and allow other users to install your theme on their forum. One of the files that you need when packaging your themes is "[i]theme-info.xml[/i]". The "[i]theme-info.xml[/i]" file keeps data stored in it of things such as the theme name, the creator, and contact details. Here is an example of a "[i]theme-info.xml[/i]" file taken from the "iGuides Theme".
When you create a theme, you can decide to package your theme in order to upload it to the SMF Theme Site and allow other users to install your theme on their forum. One of the files that you need when packaging your themes is "''theme-info.xml''". The "''theme-info.xml''" file keeps data stored in it of things such as the theme name, the creator, and contact details. Here is an example of a "''theme-info.xml''" file taken from the "iGuides Theme".


<pre>
{{code|1=<nowiki>
<?xml version="1.0"?>
<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
Line 19: Line 19:
<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on></based-on>
<based-on></based-on>
</theme-info>
</theme-info></nowiki>
</pre>
}}
At first, this file may seem hard to understand. But all those tags are there to organize the information so that even a computer can understand it. All of the text between the '''<nowiki><!--</nowiki>''' and '''<nowiki> --></nowiki>'''  tags are comments. They are there for people to read, and won't affect how the file is interpreted by a computer. You can remove them when you know what each field does. You can open "[i]theme-info.xml[/i]" in any normal text editor, and you can find the file in the root directory of your theme.
At first, this file may seem hard to understand. But all those tags are there to organize the information so that even a computer can understand it. All of the text between the '''<nowiki><!--</nowiki>''' and '''<nowiki> --></nowiki>'''  tags are comments. They are there for people to read, and will not affect how the file is interpreted by a computer. You can remove them when you know what each field does. You can open "''theme-info.xml''" in any normal text editor, and you can find the file in the root directory of your theme.


----
----


[code=1,2]<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">[/code]


The first two lines here show that the XML Version of the file is 1.0, and that it is a theme-info file - which allows SMF to read it. Don't edit this, you don't need to, and chances are that it will break the file.
{{code|1=<nowiki><?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/"></nowiki>}}
The first two lines here show that the XML Version of the file is 1.0, and that it is a theme-info file - which allows SMF to read it. Do not edit this, you do not need to, and chances are that it will break the file.


[code=3,4]<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>smf:iguides_theme</id>[/code]


These two lines tell you who made the theme, and what the theme is called. This is mainly used when uploading your theme to the SMF Theme Site, but it's recommended that you fill it in anyway. As the comments say, your name, a colon, then the theme name.
{{code|1=<nowiki><!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>smf:iguides_theme</id></nowiki>}}
These two lines tell you who made the theme, and what the theme is called. This is mainly used when uploading your theme to the SMF Theme Site, but it is recommended that you fill it in anyway. As the comments say, your name, a colon, then the theme name.


This line tells you what version of SMF this theme is made for. By default, it is the version of SMF that you installed the theme from, in this case, SMF 2.0 RC1.2. Obviously, if you make the theme for SMF 1.1.X, it will not work on SMF 2.0, unless its image changes and you do not include the "''index.template.php''" file. You cannot just change this piece of code and expect the theme to work for another version of SMF.




[code=5]<version>2.0 RC1.2</version>[/code]
{{code|1=<nowiki><!-- Theme name, used purely for aesthetics. -->
<name>iGuides Theme</name></nowiki>}}
As you could guess from this, this is the theme name. This appears where the user decides to change their theme, and in the Admin Panel where you can set the default theme, and reset the themes... This can use spaces, so does not have to have underscores or have it as one long word. When you copied the default theme, you chose the name of the theme then. However if you want to change it again, this is the place.


This line tells you what version of SMF this theme is made for. By default, it is the version of SMF that you installed the theme from, in this case, SMF 2.0 RC1.2. Obviously, if you make the theme for SMF 1.1.X, it won't work on SMF 2.0, unless it's image changes and you don't include the "[i]index.template.php[/i]" file. You cannot just change this piece of code and expect the theme to work for another version of SMF.


{{code|1=<nowiki><!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Simple Machines">[email protected]</author></nowiki>}}
This decides who the author is. It includes your EMail Address, so people can contact you, aswell as your name. In the "Latest and Greatest Themes" in your Admin Panel, it has the theme name, followed by the author name. The author name there has a "''mailto''" link to the EMail Address that you put in here. That means that if someone likes your theme or wants to contact you about something, they can by using that Address.




[code=6,7]<!-- Theme name, used purely for aesthetics. -->
{{code|1=<nowiki><!-- Website... where to get updates and more information. -->
<name>iGuides Theme</name>[/code]
<website>http://www.simplemachines.org/</website></nowiki>}}
 
As you could guess from this, this is the theme name. This appears where the user decides to change their theme, and in the Admin Panel where you can set the default theme, and reset the themes... This can use spaces, so doesn't have to have underscores or have it as one long word. When you copied the default theme, you chose the name of the theme then. However if you want to change it again, this is the place.
 
 
 
[code=8,9]<!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Simple Machines">[email protected]</author>[/code]
 
This decides who the author is. It includes your EMail Address, so people can contact you, aswell as your name. In the "Latest and Greatest Themes" in your Admin Panel, it has the theme name, followed by the author name. The author name there has a "[i]mailto[/i]" link to the EMail Address that you put in here. That means that if someone likes your theme or wants to contact you about something, they can by using that Address.
 
 
 
[code=10,11]<!-- Website... where to get updates and more information. -->
<website>http://www.simplemachines.org/</website>[/code]
 
This is your website URL. If a user wants to get updates for your theme, or maybe small theme hacks for it,  
This is your website URL. If a user wants to get updates for your theme, or maybe small theme hacks for it,  




 
{{code|1=<nowiki><!-- Template layers to use, defaults to "main". -->
[code=12,13]<!-- Template layers to use, defaults to "main". -->
<layers>html,body</layers></nowiki>}}
<layers>html,body</layers>[/code]
 
Within the themes template files, you have layers. The layers are like <html>, <body> tags, etcetera. As by default, the html and body layers are the two that only really needed to be used, but as you get better with theming, you will learn about the other layers that you can put in there.
Within the themes template files, you have layers. The layers are like <html>, <body> tags, etcetera. As by default, the html and body layers are the two that only really needed to be used, but as you get better with theming, you will learn about the other layers that you can put in there.




{{code|1=<nowiki><!-- Templates to load on startup. Default is "index". -->
<templates>index</templates></nowiki>}}
You do not really need to change this. You know you have "''something.template.php''" files in your theme directory? This bit of code tells it to load any specific templates, on startup. What is already in there, "index" is perfect for it, because that then calls all other templates when they are needed.


[code=14,15]<!-- Templates to load on startup. Default is "index". -->
<templates>index</templates>[/code]


You don't really need to change this. You know you have "[i]something.template.php[/i]" files in your theme directory? This bit of code tells it to load any specific templates, on startup. What is already in there, "index" is perfect for it, because that then calls all other templates when they're needed.
{{code|1=<nowiki><!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on></based-on></nowiki>}}
If you have based your theme off of something, or another theme, then this is the place to put it. If you just thought it up out of your head, then you can leave this blank.




{{code|1=<nowiki></theme-info></nowiki>}}
This signifies the end of the "''theme-info''" file, so that SMF will stop reading the file from there on.


[code=16,17]<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on></based-on>[/code]
If you've based your theme off of something, or another theme, then this is the place to put it. If you just thought it up out of your head, then you can leave this blank.
[code=18]</theme-info>[/code]
This signifies the end of the "[i]theme-info[/i]" file, so that SMF will stop reading the file from there on.
[hr]


----


So now that you know about the functions that "[i]theme-info.xml[/i]" uses and has, so try creating your own by editing the current one you have. You don't have to do this, but alot of people do, and it makes it seem clearer. Remove the "[i]<!--[/i]" and "[i]-->[/i]" tags and the content of them. That frees up seven lines and make it alot easier to see and read. Then edit the rest so it suits your theme. This is what the iGuides "[i]theme-info.xml[/i]" ends up as.
Now that you know about the functions that "''theme-info.xml''" uses and has, so try creating your own by editing the current one you have. You do not have to do this, but alot of people do, and it makes it seem clearer. Remove the <nowiki>"''<!--''" and "''-->''"</nowiki> tags and the content of them. That frees up seven lines and make it a lot easier to see and read. Then edit the rest so it suits your theme. This is what the iGuides <nowiki>"''theme-info.xml''"</nowiki> ends up as.


<pre><?xml version="1.0"?>
{{code|1=<nowiki><?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<id>iKorp:iGuidesTheme</id>
<id>iKorp:iGuidesTheme</id>
Line 106: Line 86:
<templates>index</templates>
<templates>index</templates>
<based-on></based-on>
<based-on></based-on>
</theme-info></pre>
</theme-info></nowiki>}}


[[Developing SMF]]
[[Category:Developing SMF]]
[[Category:SMF Themes]]

Latest revision as of 16:22, 17 July 2018

When you create a theme, you can decide to package your theme in order to upload it to the SMF Theme Site and allow other users to install your theme on their forum. One of the files that you need when packaging your themes is "theme-info.xml". The "theme-info.xml" file keeps data stored in it of things such as the theme name, the creator, and contact details. Here is an example of a "theme-info.xml" file taken from the "iGuides Theme".


<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
	<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
	<id>smf:iguides_theme</id>
	<version>2.0 RC1.2</version>
	<!-- Theme name, used purely for aesthetics. -->
	<name>iGuides Theme</name>
	<!-- Author: your email address or contact information. The name attribute is optional. -->
	<author name="Simple Machines">[email protected]</author>
	<!-- Website... where to get updates and more information. -->
	<website>http://www.simplemachines.org/</website>
	<!-- Template layers to use, defaults to "main". -->
	<layers>html,body</layers>
	<!-- Templates to load on startup. Default is "index". -->
	<templates>index</templates> 
	<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
	<based-on></based-on>
</theme-info>

At first, this file may seem hard to understand. But all those tags are there to organize the information so that even a computer can understand it. All of the text between the <!-- and --> tags are comments. They are there for people to read, and will not affect how the file is interpreted by a computer. You can remove them when you know what each field does. You can open "theme-info.xml" in any normal text editor, and you can find the file in the root directory of your theme.



<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">

The first two lines here show that the XML Version of the file is 1.0, and that it is a theme-info file - which allows SMF to read it. Do not edit this, you do not need to, and chances are that it will break the file.


<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>smf:iguides_theme</id>

These two lines tell you who made the theme, and what the theme is called. This is mainly used when uploading your theme to the SMF Theme Site, but it is recommended that you fill it in anyway. As the comments say, your name, a colon, then the theme name.

This line tells you what version of SMF this theme is made for. By default, it is the version of SMF that you installed the theme from, in this case, SMF 2.0 RC1.2. Obviously, if you make the theme for SMF 1.1.X, it will not work on SMF 2.0, unless its image changes and you do not include the "index.template.php" file. You cannot just change this piece of code and expect the theme to work for another version of SMF.


<!-- Theme name, used purely for aesthetics. -->
<name>iGuides Theme</name>

As you could guess from this, this is the theme name. This appears where the user decides to change their theme, and in the Admin Panel where you can set the default theme, and reset the themes... This can use spaces, so does not have to have underscores or have it as one long word. When you copied the default theme, you chose the name of the theme then. However if you want to change it again, this is the place.


<!-- Author: your email address or contact information. The name attribute is optional. -->
<author name="Simple Machines">[email protected]</author>

This decides who the author is. It includes your EMail Address, so people can contact you, aswell as your name. In the "Latest and Greatest Themes" in your Admin Panel, it has the theme name, followed by the author name. The author name there has a "mailto" link to the EMail Address that you put in here. That means that if someone likes your theme or wants to contact you about something, they can by using that Address.


<!-- Website... where to get updates and more information. -->
<website>http://www.simplemachines.org/</website>

This is your website URL. If a user wants to get updates for your theme, or maybe small theme hacks for it,


<!-- Template layers to use, defaults to "main". -->
<layers>html,body</layers>

Within the themes template files, you have layers. The layers are like <html>, <body> tags, etcetera. As by default, the html and body layers are the two that only really needed to be used, but as you get better with theming, you will learn about the other layers that you can put in there.


<!-- Templates to load on startup. Default is "index". -->
<templates>index</templates>

You do not really need to change this. You know you have "something.template.php" files in your theme directory? This bit of code tells it to load any specific templates, on startup. What is already in there, "index" is perfect for it, because that then calls all other templates when they are needed.


<!-- Base this theme off another? Default is blank, or no. It could be "default". -->
<based-on></based-on>

If you have based your theme off of something, or another theme, then this is the place to put it. If you just thought it up out of your head, then you can leave this blank.


</theme-info>

This signifies the end of the "theme-info" file, so that SMF will stop reading the file from there on.



Now that you know about the functions that "theme-info.xml" uses and has, so try creating your own by editing the current one you have. You do not have to do this, but alot of people do, and it makes it seem clearer. Remove the "''<!--''" and "''-->''" tags and the content of them. That frees up seven lines and make it a lot easier to see and read. Then edit the rest so it suits your theme. This is what the iGuides "''theme-info.xml''" ends up as.

<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
	<id>iKorp:iGuidesTheme</id>
	<version>2.0 RC1.2</version>
	<name>iGuides Theme</name>
	<author name="iKorp">[email protected]</author>
	<website>http://www.ikorp.net/</website>
	<layers>html,body</layers>
	<templates>index</templates>
	<based-on></based-on>
</theme-info>


Advertisement: