Custom field plugin: Unable to find template / General custom field plugin information I am still relatively new to Craft CMS.
I am trying to make a custom field plugin for Craft 3 but I am struggling to understand why I can't render my form template.
The fieldtype should render a map with markers in an entry, depending on which checkbox is clicked before map creation.
I have the following code in my Field.php file:
public function getInputHtml($value, ElementInterface $element = null): string
{ 
...

Craft::$app-&gt;getView()-&gt;setTemplateMode(View::TEMPLATE_MODE_SITE);
$input = Craft::$app-&gt;getView()-&gt;renderTemplate('locations-map/_includes/forms/mapElement', $variables);
}

And I get the following error:

This is the result from all the vague(in my opinion) information in the internet about making custom field types in Craft 3 CMS.
If you have an idea how to access this template or just any information about custom fields, please feel free to share. (Yes, I have read the official documentation)
Where are you storing your mapElement template? - Unless it is stored in the same folder as the templates for the front end of your site, then 

Craft::$app-&gt;getView()-&gt;setTemplateMode(View::TEMPLATE_MODE_SITE);


is telling craft to look in the wrong place.

If you've got it stored in your plugin directory, then you don't need to change the template mode at all, as per : https://docs.craftcms.com/v3/extend/updating-plugins.html#rendering-templates