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:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -55,6 +55,7 @@ errors:
|
||||
|
||||
# Entries
|
||||
entries:
|
||||
directory: '/entries'
|
||||
collections:
|
||||
default:
|
||||
filename: entry
|
||||
|
Reference in New Issue
Block a user