<p>In order to set an entry as your "homepage" entry you have to leave the <code>uri</code> in the section completely blank. It does not work when you insert a <code>/</code> because this route does not fetch the correct element thus Craft is not able to provide the <code>entry</code> variable in your twig template </p>

CC BY-SA 3.0
2018-03-09T11:43:54.367Z
2018-03-09T11:43:54.367Z
Robin Schambach
<p>I'm new to Craft and I'm stumbling at the first hurdle for Craft 3</p>

<p>I'm getting "Variable "entry" does not exist." and I'm certain it's something so simple I'm missing.</p>

<p>Case:</p>

<ul>
<li>Install craft 3 via composer </li>
<li>Add a Single section called "Homepage" (URI: "/" | template: "index")</li>
<li>Add "templates/index.twig" - test it with basic markup; displays correctly</li>
<li>Add plain text field to homepage section ("homepageHeader")</li>
<li>Fill out homepageHeader in control panel and save.</li>
<li>Change template to literally only "{{entry.homepageHeader}}"</li>
<li>Error above after page refresh</li>
</ul>

<p>I must be missing something VERY simple. What is it?</p>

CC BY-SA 3.0
2018-03-08T18:48:17.780Z
In order to test if you are in the correct template, you can open the `homepage` entry directly in your cp list (with the world icon) do you receive `a route not found` or `template does not exists` exception when you do that? Note: in order to set an entry as homepage you should leave the uri blank => no `/`
Robin Schambach
CC BY-SA 3.0
2018-03-09T11:18:42.287Z
Changing the URI to blank was the key! Feel free to add as an answer and I'll mark it. Thanks!
Mr DC
<templating><craft3>
Error: "Variable "entry" does not exist" on basic template
# Error: "Variable "entry" does not exist" on basic template

(Asked by: username_0 on 2018-03-08)

I'm new to Craft and I'm stumbling at the first hurdle for Craft 3

I'm getting "Variable "entry" does not exist." and I'm certain it's something so simple I'm missing.

Case:

* Install craft 3 via composer
* Add a Single section called "Homepage" (URI: "/" | template: "index")
* Add "templates/index.twig" - test it with basic markup; displays correctly
* Add plain text field to homepage section ("homepageHeader")
* Fill out homepageHeader in control panel and save.
* Change template to literally only "{{entry.homepageHeader}}"
* Error above after page refresh

I must be missing something VERY simple. What is it?

**Tags:** templating, craft3

> **Comments:**
> **username_1**: In order to test if you are in the correct template, you can open the `homepage` entry directly in your cp list (with the world icon) do you receive `a route not found` or `template does not exists` exception when you do that? Note: in order to set an entry as homepage you should leave the uri blank => no `/`  
> **username_0**: Changing the URI to blank was the key! Feel free to add as an answer and I'll mark it. Thanks!  

---

## 1 answers

### Answer by username_1 on 2018-03-09. Score: 4 | Accepted answer

In order to set an entry as your "homepage" entry you have to leave the `uri` in the section completely blank. It does not work when you insert a `/` because this route does not fetch the correct element thus Craft is not able to provide the `entry` variable in your twig template


---

