I'm trying to include a menu in my page with this code:
<%- include ../mon/menu %>
Here is the file directory: /views/mon/menu.ejs
Here is my menu.ejs:
<div class="button" id="menu-btn">
<a class="btn-open" href="#"></a>
</div>
<div class="overlay">
<div class="wrap">
<ul class="wrap-nav">
<li>
<a href="/">Wele Page</a>
<ul>
<li>
<a href="/main">Main Page</a>
</li>
<li>
<a href="/vungtau">Vũng Tàu</a>
</li>
<li>
<a href="/suoimo">Đồng Nai - Suối Mơ</a>
</li>
<li>
<a href="/dalat">Đà Lạt</a>
</li>
<li>
<a href="/video">Video</a>
</li>
</ul>
</ul>
</div>
</div>
I got a 500 Internal Server Error but I did not know why? I'm following this tutorial:
I did many search on google but it s no help.
I'm trying to include a menu in my page with this code:
<%- include ../mon/menu %>
Here is the file directory: /views/mon/menu.ejs
Here is my menu.ejs:
<div class="button" id="menu-btn">
<a class="btn-open" href="#"></a>
</div>
<div class="overlay">
<div class="wrap">
<ul class="wrap-nav">
<li>
<a href="/">Wele Page</a>
<ul>
<li>
<a href="/main">Main Page</a>
</li>
<li>
<a href="/vungtau">Vũng Tàu</a>
</li>
<li>
<a href="/suoimo">Đồng Nai - Suối Mơ</a>
</li>
<li>
<a href="/dalat">Đà Lạt</a>
</li>
<li>
<a href="/video">Video</a>
</li>
</ul>
</ul>
</div>
</div>
I got a 500 Internal Server Error but I did not know why? I'm following this tutorial: https://scotch.io/tutorials/use-ejs-to-template-your-node-application
I did many search on google but it s no help.
Share Improve this question asked May 3, 2018 at 15:45 Nguyen Hoang VuNguyen Hoang Vu 8634 gold badges18 silver badges38 bronze badges 1- You should accept solution for this answer. – Prathamesh More Commented Apr 2, 2020 at 4:34
3 Answers
Reset to default 4try this
<%- include('../mon/menu.ejs') %>
docs http://ejs.co/#docs
If I use this folder structure:
../views/partials/header.ejs
../views/partials/footer.ejs
../views/users.ejs
then in users.ejs:
<%- include('./partials/header.ejs') %>
<body>
...
</body>
<%- include("./partials/footer.ejs") %>
Try to use this new syntax
<%- include("partials/header") %>
<%- include("partials/footer") %>