html-id example

This commit is contained in:
David Botton 2021-02-01 22:34:44 -05:00
parent 3d7dc17cd3
commit f4b0abe422

View file

@ -34,7 +34,7 @@
(html-id nil) (html-id nil)
(auto-place t)) (auto-place t))
(let ((new-obj (create-unordered-list obj :class class (let ((new-obj (create-unordered-list obj :class class
:html-if html-id :html-id html-id
:auto-place auto-place))) :auto-place auto-place)))
;; Using change-class we can reuse the parent clog-unordered-lists's ;; Using change-class we can reuse the parent clog-unordered-lists's
;; create method and it's initialization. Otherwise we can use ;; create method and it's initialization. Otherwise we can use
@ -57,8 +57,10 @@
(defun on-new-window (body) (defun on-new-window (body)
(clog-toggler:init-toggler body) (clog-toggler:init-toggler body)
;; Now we build or CLOG-Toggler ;; Now we build our CLOG-Toggler
(let* ((toggler (clog-toggler:create-toggler body)) ;; All create-functions also allow setting the :html-id instead of
;; using a generated id.
(let* ((toggler (clog-toggler:create-toggler body :html-id "myid"))
(item (create-list-item toggler :content "Top of tree")) (item (create-list-item toggler :content "Top of tree"))
(list-b (create-unordered-list item)) (list-b (create-unordered-list item))
(item (create-list-item list-b :content "Item 1")) (item (create-list-item list-b :content "Item 1"))