A question about "models"

I am using a .csv file built to create virtual pages for each location listed in the CSV. It is functioning correctly.

The question is: How can I store data from the CSV into the blueprint (generated) of each location, utilizing a specific field type? For example, I want to use the locator plugin to assign latitude and longitude values based on the address provided.

For that use case, you need to mix content that exists in the file system (page content file), with the data from your virtual pages, see Merging content sources | Kirby CMS

By the way, you don’t store data in the blueprint but in the content file.

ok, so the question is: can i use data from .csv to generate pages, and for each page use the information about “address” [column of the .csv] writing them into the content file in a “locator” field [that generate lat and lng dinamically]?
Thank you for your answers.

Ok, so you don’t want to keep the virtual pages but create page in the file system from the data in the .csv? That is of course possible as well, see also: Page::create() | Kirby CMS

As regards filling the field values, I don’t think this is possible in a PHP script, because there are no methods provided in the plugin to do this backend side. The mapbox API queries happen in the frontend part, i.e. the vue files.

So, yes, you can do it, but would have to do the API queries in your PHP.

ok, now i don’t understand one last thing…

according the reference here Content from a spreadsheet | Kirby CMS

i create a “animals.php” model like this

<?php

use Kirby\Uuid\Uuid;

class AnimalsPage extends Page
{

    public function children(): Pages
    {
        if ($this->children instanceof Pages) {
            return $this->children;
        }

        $csv      = csv($this->root() . '/animals.csv', ';');
        $children = array_map(function ($animal) {
            return [
                'slug'     => Str::slug($animal['Scientific Name']),
                'template' => 'animal',
                'model'    => 'animal',
                'num'      => 0,
                'content'  => [
                    'title'       => $animal['Scientific Name'],
                    'commonName'  => $animal['Common Name'],
                    'description' => $animal['Description'],
                    'uuid'        => Uuid::generate(),

                ]
            ];
        }, $csv);

        return $this->children = Pages::factory($children, $this);
    }

}

in the reference here Page::create() | Kirby CMS
there is an example for the command “page create”

$page = Page::create([
  'slug'     => 'a-new-article',
  'template' => 'article',
  'content' => [
    'title'  => 'A new article',
    'author' => 'Homer Simpson'
  ]
]);

how can i use this into the model? have you got any documentation about this?