Difference between revisions of "VbzCart/tables/cat topic"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(saving work; still revising)
(tidying, reorganizing, updating; note about sorting)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
* '''Status''': Coding in progress
+
===Usage===
* '''Used by''': {{vbzcart|table|brs_titles_x_topics}}
+
* '''Used by''': {{vbzcart|table|cat_title_x_topic}}, {{vbzcart/query|qryTitleTopic_Titles}}
* '''Future''': rename to {{vbzcart|table|cat_topic}}; rename {{vbzcart|table|brs_titles_x_topics}} to {{vbzcart|table|cat_title_x_topic}}
+
 
* '''History''':
+
Generally, Topics are to be used in the following places:
** '''2010-10-13''' Coding (store and admin) in progress; noted 3 possible fields to add
+
* Topic pages (show what titles are assigned)
* '''Notes''':
+
* Topic index (show what item types are [(1) available (2) in stock] for each topic)
** Fields I'm considering adding here:
+
* Title pages
*** A) a flag to indicate that thumbnails of other items in the same category should be shown
+
** show what topics the title is in
*** B) a prefix to be added to NameFull for all child nodes (and maybe a flag to override it)
+
** summarize how many other titles are available for each topic
*** C) a way of creating "virtual" nodes to cross-link to related topics in other branches
+
** (future) show thumbnails for titles in topics with the A flag
* '''Uses''': Topics are (eventually) to be used in the following places:
+
 
** Topic pages (show what titles are assigned)
+
In most display context, Topics should be sorted properly. (I thought I had already documented this but can't find it anywhere, so this is a first-pass reconstruction.) Sorting should generally be:<mysql>ORDER BY Sort, Name</mysql>
** Topic index (show what item types are [(1) available (2) in stock] for each topic)
+
===History===
** Title pages
+
* '''2010-10-13''' Coding (store and admin) in progress; noted 3 possible fields to add
*** show what topics the title is in
+
* '''2011-02-04''' working
*** summarize how many other titles are available for each topic
+
* '''2011-02-05''' New fields: '''NameMeta''' and '''Usage'''
*** (future) show thumbnails for titles in topics with the A flag
+
* '''2011-02-24''' New fields: '''cntTiHere''' and '''cntTiSub''' to support lookup-free indication of where to find active titles
 +
* '''2011-09-28''' renamed from '''brs_topics''' to '''cat_topic'''
 +
===Future===
 +
* Fields I'm considering adding:
 +
** A) a flag to indicate that thumbnails of other items in the same category should be shown
 +
** B) a prefix to be added to NameFull for all child nodes (and maybe a flag to override it)
 +
** C) a way of creating "virtual" nodes to cross-link to related topics in other branches
 
==SQL==
 
==SQL==
<section begin=sql /><mysql>DROP TABLE IF EXISTS `brs_topics`;
+
<mysql>DROP TABLE IF EXISTS `cat_topic`;
CREATE TABLE `brs_topics` (
+
CREATE TABLE `cat_topic` (
 
   `ID`        INT              NOT NULL AUTO_INCREMENT,
 
   `ID`        INT              NOT NULL AUTO_INCREMENT,
   `ID_Parent` INT          DEFAULT NULL COMMENT "brs_topics.ID of parent topic",
+
   `ID_Parent` INT          DEFAULT NULL COMMENT "cat_topic.ID of parent topic",
 
   `Name`      VARCHAR(128)    NOT NULL COMMENT "generic name (context-free, but as short as possible)",
 
   `Name`      VARCHAR(128)    NOT NULL COMMENT "generic name (context-free, but as short as possible)",
 
   `NameTree`  VARCHAR(64)  DEFAULT NULL COMMENT "name within context of parent; defaults to Name",
 
   `NameTree`  VARCHAR(64)  DEFAULT NULL COMMENT "name within context of parent; defaults to Name",
 
   `NameFull`  VARCHAR(255) DEFAULT NULL COMMENT "descriptive standalone name (context free, can be long)",
 
   `NameFull`  VARCHAR(255) DEFAULT NULL COMMENT "descriptive standalone name (context free, can be long)",
 +
  `NameMeta`  VARCHAR(144) DEFAULT NULL COMMENT "plain text for HTML META description tag",
 +
  `Usage`    VARCHAR(255) DEFAULT NULL COMMENT "usage instructions for this topic - show when editing topic",
 +
/*  `Details`  VARCHAR(255) DEFAULT NULL COMMENT "additional information of interest to regular users (may include HTML)", */
 
   `Sort`      VARCHAR(15)  DEFAULT NULL COMMENT "optional sorting key",
 
   `Sort`      VARCHAR(15)  DEFAULT NULL COMMENT "optional sorting key",
 
   `Variants`  VARCHAR(255) DEFAULT NULL COMMENT "synonyms and other keywords which should find this topic",
 
   `Variants`  VARCHAR(255) DEFAULT NULL COMMENT "synonyms and other keywords which should find this topic",
 
   `Mispeled`  VARCHAR(255) DEFAULT NULL COMMENT "same as Variants, but these are WRONG spellings; avoid displaying",
 
   `Mispeled`  VARCHAR(255) DEFAULT NULL COMMENT "same as Variants, but these are WRONG spellings; avoid displaying",
 +
  `cntTiHere` INT          DEFAULT NULL COMMENT "calculated: number of active titles for this topic",
 +
  `cntTiSub`  INT          DEFAULT NULL COMMENT "calculated: sum of active titles for all subtopics",
 
   PRIMARY KEY(`ID`)
 
   PRIMARY KEY(`ID`)
 
) ENGINE = MYISAM;</mysql>
 
) ENGINE = MYISAM;</mysql>
<section end=sql />
 

Latest revision as of 00:58, 24 March 2016

About

Usage

  1. REDIRECT Template:l/vc/query

Generally, Topics are to be used in the following places:

  • Topic pages (show what titles are assigned)
  • Topic index (show what item types are [(1) available (2) in stock] for each topic)
  • Title pages
    • show what topics the title is in
    • summarize how many other titles are available for each topic
    • (future) show thumbnails for titles in topics with the A flag

In most display context, Topics should be sorted properly. (I thought I had already documented this but can't find it anywhere, so this is a first-pass reconstruction.) Sorting should generally be:<mysql>ORDER BY Sort, Name</mysql>

History

  • 2010-10-13 Coding (store and admin) in progress; noted 3 possible fields to add
  • 2011-02-04 working
  • 2011-02-05 New fields: NameMeta and Usage
  • 2011-02-24 New fields: cntTiHere and cntTiSub to support lookup-free indication of where to find active titles
  • 2011-09-28 renamed from brs_topics to cat_topic

Future

  • Fields I'm considering adding:
    • A) a flag to indicate that thumbnails of other items in the same category should be shown
    • B) a prefix to be added to NameFull for all child nodes (and maybe a flag to override it)
    • C) a way of creating "virtual" nodes to cross-link to related topics in other branches

SQL

<mysql>DROP TABLE IF EXISTS `cat_topic`; CREATE TABLE `cat_topic` (

 `ID`        INT              NOT NULL AUTO_INCREMENT,
 `ID_Parent` INT          DEFAULT NULL COMMENT "cat_topic.ID of parent topic",
 `Name`      VARCHAR(128)     NOT NULL COMMENT "generic name (context-free, but as short as possible)",
 `NameTree`  VARCHAR(64)  DEFAULT NULL COMMENT "name within context of parent; defaults to Name",
 `NameFull`  VARCHAR(255) DEFAULT NULL COMMENT "descriptive standalone name (context free, can be long)",
 `NameMeta`  VARCHAR(144) DEFAULT NULL COMMENT "plain text for HTML META description tag",
 `Usage`     VARCHAR(255) DEFAULT NULL COMMENT "usage instructions for this topic - show when editing topic",

/* `Details` VARCHAR(255) DEFAULT NULL COMMENT "additional information of interest to regular users (may include HTML)", */

 `Sort`      VARCHAR(15)  DEFAULT NULL COMMENT "optional sorting key",
 `Variants`  VARCHAR(255) DEFAULT NULL COMMENT "synonyms and other keywords which should find this topic",
 `Mispeled`  VARCHAR(255) DEFAULT NULL COMMENT "same as Variants, but these are WRONG spellings; avoid displaying",
 `cntTiHere` INT          DEFAULT NULL COMMENT "calculated: number of active titles for this topic",
 `cntTiSub`  INT          DEFAULT NULL COMMENT "calculated: sum of active titles for all subtopics",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>