Render template from a shared folder in Phoenix 1.7 and above

In the older versions of Phoenix, if you had to render a template from a shared or common folder, for example a _menu.html.heex file inside templates/layout folder, you did something like this if the file was in a different folder:
<%= render MyAppWeb.LayoutView, "_menu.html", assigns %>

or simply this, if the file was in the layout folder itself:
<%= render "_menu.html", assigns %>

Since Phoenix 1.7, you can follow these steps to achieve the same:
1. Create a folder to keep shared templates inside the my_app_web/controllers folder, for example: shared.
2. Inside this folder, add your template file: menu.html.heex (the name doesn't need to start with an underscore)
3. Open the *_html.ex file for the controller for which you want to use the shared file, eg: page_html.ex for page_controller and embed the shared templates below the existing embed_template statement(s):
embed_templates "page_html/*"
embed_templates "shared/*" # add this line

If you want to add just one or two files from shared folder, you can include just those files like this:
embed_templates "shared/menu.html"

4. Open the file from the page_html folder in which you want to add shared template. Add the template like a component in the file where you want to render he template:
<header>
  <.menu />
</header>

If you need to pass assigns to the template file, you can do it same as any other component:
<header>
  <.menu type="admin" current_user={@current_user}/>
</header>

The type & current_user assigns will be accessible inside shared/menu.html.heex file as: @type & @current_user.