update tags on page save

the list of tags was not being updated when an edited page was saved,
which is needed for the front end tags page.

all cleaned up and active
This commit is contained in:
ro 2024-04-22 15:19:06 -06:00
parent 234453b900
commit 69eb9905a2
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
3 changed files with 8 additions and 2 deletions

View file

@ -133,7 +133,7 @@ class PageRepository implements PageRepositoryInterface
//upadte settings if needed //upadte settings if needed
$body->path = $path; $body->path = $path;
$this->settings->updateMenu($body); $this->settings->updateMenu($body);
//Settings::updateTags(); $this->settings->updateTags($this->sort->tags());
// if new page added, update current index in Settings file // if new page added, update current index in Settings file
if ($task == 'create') { if ($task == 'create') {
$this->settings->updatePageIndex(); $this->settings->updatePageIndex();

View file

@ -97,6 +97,11 @@ class SettingsService
$this->docs->writeSettings($settings); $this->docs->writeSettings($settings);
} }
public function updateTags($update)
{
$this->docs->writeSettings($update, env('TAGS_PATH'));
}
public function sync($data) public function sync($data)
{ {
//dd($data->global->renderOnSave); //dd($data->global->renderOnSave);

View file

@ -60,13 +60,14 @@ class SortingService
} }
$tagData = []; $tagData = [];
//dd($this->settings->getTags()['pages']);
$tagData = [ $tagData = [
'debug' => $debug, // for theme kit 'debug' => $debug, // for theme kit
'tags' => $this->p_tags, 'tags' => $this->p_tags,
'theme' => $this->info['theme'], // for theme kit 'theme' => $this->info['theme'], // for theme kit
'title' => 'Pages Tagged as Tag', 'title' => 'Pages Tagged as Tag',
'dynamicRender' => $this->info['dynamicRender'], 'dynamicRender' => $this->info['dynamicRender'],
'pages' => $this->settings->getTags()[3]['pages'], 'pages' => $this->settings->getTags()['pages'],
'info' => $this->info, 'info' => $this->info,
'menu' => $this->settings->getMenu(), 'menu' => $this->settings->getMenu(),
'media' => [ 'media' => [