---
title: "How To View Template Code In Joomla 4"
description: "Joomla templates, plus modules you can publish, make up the look, feel, and function of your site. But what if you want to edit the actual template code to do things outside of the scope of what..."
url: https://www.inmotionhosting.com/support/edu/joomla/joomla-4/template-code/
date: 2021-08-27
modified: 2021-11-19
author: "Christopher Maiorana"
categories: ["Joomla 4"]
type: post
lang: en
---

# How To View Template Code In Joomla 4

![](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/View-and-Edit-Template-Code-in-Joomla-4-1024x538.png)

Joomla templates, plus modules you can publish, make up the look, feel, and function of your site. But what if you want to edit the actual template code to do things outside of the scope of what comes with the template itself? With a note of caution, it's easy to edit your template, as long as you know what you are doing.

Editing template code can be destructive to your site. Make sure you have received explicit instruction and have a solid backup of your site -- just in case.

- [How To Add the Template Code Button To Home Dashboard](#template-code)
- [Some Notes About Editing Code](#some-notes)

In this article, you will learn how to add a button to the home dashboard that will allow you to quickly and easily view and edit template code.

The site menu without the template code button:

![Site module in home dashboard with no template code icon](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/joomla4_Selection_006.png)

## How To Add the Template Code Button To Home Dashboard

Follow the steps below to add the template code button to the home dashboard in Joomla 4:

1. [Log into the Joomla admin area](/support/edu/joomla/how-to-log-in-to-administrative-dashboard/)
2. Navigate to the *Site* module
3. Click the gears icon
4. Click **Edit** in the dropdown
5. Scroll down to the *Template Code Icon* button and turn it to **Show**
6. Click **Save** or **Save & Close**

Now, returning to the site menu, you will see the template code button:

![Site module with template code icon in home dashboard](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/joomla4_Selection_007.png)

Now you can quickly access template code and make changes.

## Some Notes About Editing Code

Any time that you are editing the code of your template you must be careful and make sure you know exactly what line of code you want to change and how that line affects other files. Joomla runs on the PHP scripting language which, like many other languages, relies upon file includes to pull different content into other files. So in addition to editing one file you might be unintentionally affecting how other aspects of the template work together.

![The template code editor](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/joomla4_Selection_009.png)

**If your edit breaks the site, Joomla will not warn you.** This means you could edit one file and reload your page to find your site looking like this:

![Broken Joomla site](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/joomla4_Selection_008.png)
