Browse Source

implement update-single-nav-menu-item in nera package.

This function is so the user can add/remove a single page from the
nav. menu whilst editting the page.
stable
Craig Oates 2 years ago
parent
commit
db4393ddac
  1. 11
      src/nera.lisp

11
src/nera.lisp

@ -44,7 +44,8 @@
#:update-archive-entry-property
#:latest-archive-editted-entries
#:latest-editted-pages
#:latest-storage-editted-files))
#:latest-storage-editted-files
#:update-single-nav-menu-item))
(in-package #:nera-db)
(defparameter *tables* '(user site-settings page storage-file archive-entry)
@ -248,6 +249,14 @@ editted article entry as the first item in the list.."
(utils:checkbox-to-bool (cdr page)))
(mito:save-dao page-to-update)))))
(defun update-single-nav-menu-item (slug show-in-nav)
"Toggles a single page from the navigation menu."
(with-connection (db)
(let ((page-to-update (mito:find-dao 'page :slug slug)))
(setf (pages::enable-nav-menu-p page-to-update) show-in-nav)
;; (utils:checkbox-to-bool show-in-nav))
(mito:save-dao page-to-update))))
(defun nav-menu-slugs ()
(with-connection (db)
(mito:select-dao 'page

Loading…
Cancel
Save