2020 <ol >
2121 <li >Add tag input box to your module's item edit form (required)</li >
2222 <li >Add tag storage to your item submission page (required)</li >
23+ <li >Removing tags (required)</li >
2324 <li >Define functions to build info of tagged items (required)</li >
2425 <li >Add tag display API to your item display page and include tag template in your item template (optional)</li >
2526 <li >Add module tag view page and tag list page (optional)</li >
@@ -52,12 +53,27 @@ $form_item->addElement(new \XoopsModules\Tag\FormTag('item_tag', 60, 255, $itemi
5253<code>/** @var \XoopsModules\Tag\TagHandler $tagHandler */
5354$tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); // xoops_getModuleHandler('tag', 'tag');
5455$tagHandler->updateByItem($_POST['item_tag'], $itemid, $GLOBALS['xoopsModule']->getVar('dirname'), $catid = 0);
56+ </code><{/literal } ></td ></tr >
57+ </tbody >
58+ </table >
59+ </div >
60+
61+ <h3 class =" odd" id =" tag_input_box" >Step 3: Removing tags (When content is deleted)</h3 >
62+ <div class =" even marg10 boxshadow1" >
63+ <table >
64+ <tbody >
65+ <tr ><td >File:</td ><td >delete.item.php</td ></tr >
66+ <tr ><td >Code:</td >
67+ <td ><{literal } >
68+ <code>/** @var \XoopsModules\Tag\TagHandler $tagHandler */
69+ $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); // xoops_getModuleHandler('tag', 'tag');
70+ $tagHandler->updateByItem('', $itemid, $GLOBALS['xoopsModule']->getVar('dirname'), $catid = 0);
5571 </code><{/literal } ></td ></tr >
5672 </tbody >
5773 </table >
5874 </div >
5975
60- <h3 class =" odd" id =" tag_input_box" >Step 3 : Define functions to build info of tagged itemse</h3 >
76+ <h3 class =" odd" id =" tag_input_box" >Step 4 : Define functions to build info of tagged itemse</h3 >
6177 <div class =" even marg10 boxshadow1" >
6278 <table >
6379 <tbody >
@@ -67,7 +83,7 @@ $tagHandler->updateByItem($_POST['item_tag'], $itemid, $GLOBALS['xoopsModule']->
6783<code>/** Get item fields: title, content, time, link, uid, uname, tags *
6884 * @param $items
6985 */
70- function mymodule_tag_iteminfo($items)
86+ function mymodule_tag_iteminfo(& $items)
7187{
7288 $items_id = [];
7389 foreach (array_keys($items ) as $cat_id ) {
@@ -109,7 +125,7 @@ function mymodule_tag_synchronization($mid)
109125 </table >
110126 </div >
111127
112- <h3 class =" odd" id =" tag_input_box" >Step 4 : Display tags on the item page</h3 >
128+ <h3 class =" odd" id =" tag_input_box" >Step 5 : Display tags on the item page</h3 >
113129 <div class =" even marg10 boxshadow1" >
114130 <table >
115131 <tbody >
@@ -125,7 +141,7 @@ $GLOBALS['xoopsTpl']->display('db:tag_bar.tpl');
125141 </table >
126142 </div >
127143
128- <h3 class =" odd" id =" tag_input_box" >Step 5 : Create tag list page and tag view page</h3 >
144+ <h3 class =" odd" id =" tag_input_box" >Step 6 : Create tag list page and tag view page</h3 >
129145 <div class =" even marg10 boxshadow1" >
130146 <table >
131147 <tbody >
@@ -145,7 +161,7 @@ require_once $GLOBALS['xoops']->path('/modules/tag/view.tag.php');
145161 </table >
146162 </div >
147163
148- <h3 class =" odd" id =" tag_input_box" >Step 6 : Create tag blocks</h3 >
164+ <h3 class =" odd" id =" tag_input_box" >Step 7 : Create tag blocks</h3 >
149165 <div class =" even marg10 boxshadow1" >
150166 <table >
151167 <tbody >
0 commit comments