1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-10 07:06:45 +02:00

feat(entries): add ability to set directory for Entries service

This commit is contained in:
Awilum
2021-09-01 20:11:39 +03:00
parent 451b81779e
commit 3643831430
2 changed files with 4 additions and 3 deletions

View File

@@ -304,7 +304,7 @@ class Entries
$currentEntryID = strings($currenEntry->getPath())
->replace('\\', '/')
->replace(PATH['project'] . '/entries/', '')
->replace(PATH['project'] . $this->options['directory'] . '/', '')
->trim('/')
->toString();
@@ -561,7 +561,7 @@ class Entries
// Set collection options
$this->registry()->set('collection.options', $this->getCollectionOptions($id));
return PATH['project'] . '/entries/' . $id . '/' . $this->registry()->get('collection.options.filename') . '.' . $this->registry()->get('collection.options.extension');
return PATH['project'] . $this->options['directory'] . '/' . $id . '/' . $this->registry()->get('collection.options.filename') . '.' . $this->registry()->get('collection.options.extension');
}
/**
@@ -575,7 +575,7 @@ class Entries
*/
public function getDirectoryLocation(string $id): string
{
return PATH['project'] . '/entries/' . $id;
return PATH['project'] . $this->options['directory'] . '/' . $id;
}
/**

View File

@@ -55,6 +55,7 @@ errors:
# Entries
entries:
directory: '/entries'
collections:
default:
filename: entry