Using com config for frontend template style editing: Difference between revisions

From Joomla! Documentation

Buddhima (talk | contribs)
No edit summary
Cmb (talk | contribs)
Some markup and phrasing changes. Changes for Words2Watch compliance.
 
(3 intermediate revisions by one other user not shown)
Line 2: Line 2:
{{RightTOC}}
{{RightTOC}}
== Introduction ==
== Introduction ==
In early versions, it was a bit difficult thing for users to figure out how to change basic settings after installing Joomla! for the first time. To reduce that difficulty front-end component com_config make it possible to do some of those settings through front-end. Through this template view of com_config, super users can easily change current template style parameters and view the changes soon after clicking Save!
In early versions, it was a bit difficult thing for users to figure out how to change basic settings after installing Joomla! for the first time. To reduce that difficulty, the Frontend component ''com_config'' makes it possible to do some of those settings through Frontend. Through this template view of ''com_config'', Super Users can easily change the current template style parameters and view the changes soon after clicking ''Save''.


== Access to Templates View ==
== Access to Templates View ==
For beginners, we encourage you to install Joomla! With sample data Blog English (GB) Sample Data or Brochure English (GB) Sample Data. If you installed with one of two data sets, you can access it by clicking “Template Settings” on Main Menu (login as super-user will be required).
For beginners, we encourage you to install Joomla! with sample data ''Blog English (GB) Sample Data'' or ''Brochure English (GB) Sample Data''. If you installed with one of the two data sets, you can access it by clicking ''Template Settings'' on the Main Menu. (Logging in as a Super User is required).


In other cases you can simply add it to the any menu. Following steps are for adding it to Main menu (super-user privileges are required).
In other cases simply add it to any menu. The following steps are for adding it to Main menu:


1. Login to back-end (administrator view)
1. Login to Backend (Administrator view)


2. Go to Menus -> Main Menu -> Add New Item
2. Go to {{rarr|Menus,Main Menu,Add New Item}}


[[File:Screencapture-Add-Main-Menu-Menu-Item.png]]
[[File:Screencapture-Add-Main-Menu-Menu-Item.png]]


3. Set “Menu Item Type” to ConfigurationManager -> Display Template Options
3. Set ''Menu Item Type'' to {{rarr|ConfigurationManager,Display Template Options}}


[[File:Screencapture-Add-Display-Template-Options-For-Menu-Item.png]]
[[File:Screencapture-Add-Display-Template-Options-For-Menu-Item.png]]


4. Set “Menu Title” to “Template Settings”
4. Set ''Menu Title'' to ''Template Settings''


5. Finally click “Save & Close”
5. Finally, click ''Save & Close''


6. Now login front front-end as the super-user
6. Log into Frontend as a Super User.


7. Click on menu item “Template Settings” on Main Menu
7. Click on menu item ''Template Settings'' on the Main Menu.


[[File:Screencapture-FrontEnd-Main-Menu-Template-Settings.png]]
[[File:Screencapture-FrontEnd-Main-Menu-Template-Settings.png]]


8. You will get Template Settings which is allowed by the current front-end template
8. You will get the Template Settings allowed for the current Frontend template.


[[File:Screencapture-FrontEnd-Template-Settings.png]]
[[File:Screencapture-FrontEnd-Template-Settings.png]]


 
You can view the settings and change them quickly.
You can do settings and view those changes very quickly. Hope you feel that this is pretty much easier than changing template settings from administrator view.


== For Template Developers ==
== For Template Developers ==
This has the flexibility for template developers to specify the parameters which to be shown on the front-end. It is just to adding com_config.xml file with relevant fields to the template folder as shown below.
There is flexibility for template developers to specify the parameters that to be shown on the Frontend. Just add a ''com_config.xml'' file with relevant fields to the template folder as shown below.


[[File:Screencapture-Com_Config-XML-For-Templates.png]]
[[File:Screencapture-Com_Config-XML-For-Templates.png]]


Note: If no such file included in template folder, this component will take all the config fields mentioned in the templateDetails.xml
Note: If no such file is included in template folder, this component will take all the configuration fields mentioned in ''templateDetails.xml''.


== Example ==
== Example ==
For this case, Protostar template is used (which is the default template after Joomla! 3.0).  
For this case, the Protostar template is used.


1. Open the folder PATH_TO_JOOMLA_DIR -> templates -> protostar
1. Open the folder {{rarr|PATH_TO_JOOMLA_DIR,templates,protostar}}.


2. Create a file named com_config.xml
2. Create a ''com_config.xml'' file.


3. Add the following code
3. Add this code:


<source lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<config>
<config>
<fields name="params">
<fields name="params">
Line 73: Line 71:
</fields>
</fields>
</config>
</config>
</source>
</syntaxhighlight>


4. Above code segment says only to show Template Colour, Background Colour and Logo fields only for the front-end.
4. The above code segment specifies only the Template Colour, Background Colour and Logo fields.


5. Thereafter you clicking Template Settings you will only see the previously mentioned fields are there.
5. After clicking ''Template Settings'', you will only see the previously mentioned fields.


[[File:Screencapture-FrontEnd-Main-Menu-Template-Options-Reduced-Parameters.png]]
[[File:Screencapture-FrontEnd-Main-Menu-Template-Options-Reduced-Parameters.png]]


Similarly for any template this can be used, but special inspection of the template designer may be required.
This can be used for any template, but special inspection by the template designer may be required.


== Conclusion ==
== Conclusion ==
From this feature, it is believed that Joomla! super-users will get more efficient way of customizing their web sites and also template developers will use this for their beneficial to serve the clients.
From this feature, it is believed that Joomla! Super Users will have a more efficient way of customizing their websites.
 
Important: Some templates will not directly support this by adding a com_config.xml. Templates also should support viewing fields added to com_config.xml. Therefore it is highly recommended to consult the template developer for concerns arising when enabling this feature for a particular template.


--[[User:Buddhima|Buddhima]] ([[User talk:Buddhima|talk]]) 04:53, 13 October 2013 (CDT)
Important: Some templates will not directly support this by adding a ''com_config.xml'' file. Templates also should support viewing fields added to ''com_config.xml''. Consult the template developer when enabling this feature.

Latest revision as of 22:58, 19 November 2022

Introduction

In early versions, it was a bit difficult thing for users to figure out how to change basic settings after installing Joomla! for the first time. To reduce that difficulty, the Frontend component com_config makes it possible to do some of those settings through Frontend. Through this template view of com_config, Super Users can easily change the current template style parameters and view the changes soon after clicking Save.

Access to Templates View

For beginners, we encourage you to install Joomla! with sample data Blog English (GB) Sample Data or Brochure English (GB) Sample Data. If you installed with one of the two data sets, you can access it by clicking Template Settings on the Main Menu. (Logging in as a Super User is required).

In other cases simply add it to any menu. The following steps are for adding it to Main menu:

1. Login to Backend (Administrator view)

2. Go to Menus  Main Menu  Add New Item

3. Set Menu Item Type to ConfigurationManager  Display Template Options

4. Set Menu Title to Template Settings

5. Finally, click Save & Close

6. Log into Frontend as a Super User.

7. Click on menu item Template Settings on the Main Menu.

8. You will get the Template Settings allowed for the current Frontend template.

You can view the settings and change them quickly.

For Template Developers

There is flexibility for template developers to specify the parameters that to be shown on the Frontend. Just add a com_config.xml file with relevant fields to the template folder as shown below.

Note: If no such file is included in template folder, this component will take all the configuration fields mentioned in templateDetails.xml.

Example

For this case, the Protostar template is used.

1. Open the folder PATH_TO_JOOMLA_DIR  templates  protostar.

2. Create a com_config.xml file.

3. Add this code:

<?xml version="1.0" encoding="utf-8"?>
<config>
	<fields name="params">
		<fieldset name="basics">
			<field name="templateColor" class="" type="color" default="#08C"
				label="TPL_PROTOSTAR_COLOR_LABEL"
				description="TPL_PROTOSTAR_COLOR_DESC" />

			<field name="templateBackgroundColor" class="" type="color" default="#F4F6F7"
				label="TPL_PROTOSTAR_BACKGROUND_COLOR_LABEL"
				description="TPL_PROTOSTAR_BACKGROUND_COLOR_DESC" />

			<field name="logoFile" class="" type="media" default=""
				label="TPL_PROTOSTAR_LOGO_LABEL"
				description="TPL_PROTOSTAR_LOGO_DESC" />

		</fieldset>
	</fields>
</config>

4. The above code segment specifies only the Template Colour, Background Colour and Logo fields.

5. After clicking Template Settings, you will only see the previously mentioned fields.

This can be used for any template, but special inspection by the template designer may be required.

Conclusion

From this feature, it is believed that Joomla! Super Users will have a more efficient way of customizing their websites.

Important: Some templates will not directly support this by adding a com_config.xml file. Templates also should support viewing fields added to com_config.xml. Consult the template developer when enabling this feature.