Skip to content

Implementation of New Data Entries

Tony edited this page Jun 7, 2019 · 1 revision

The simplest contributions to StudyGameDev are to its topics/chapters/sections/resources hierarchy.

Resources

Contributions to the list of resource links are made in the form of database insertions via that TaffyDB function .insert() to the database dLinks. You must specify each of the entry's fields and values (sSection, sTag, sTagColor, sURL, sSummary, and sDetails). The easiest way to make this is to simply use the code generator on the site. Alternatively, you can base your submission on the contents of db-init.js, following the color coordination of the tags according to the multi line comment at the top. Your pull request should only affect the db-init.js file.

Chapters & Sections

Chapters are like a wrapper for the chapter's title button and the section containing its links. So both have to be created at the same time. New chapters are created in the db-init.js file, as well, in the dTopics database. Find the topic you wish to add before contributing and create a new entry (an array with two elements) in the topic's aChapters field. The contribution should look like this:

dTopics.insert( { "sTopicID" : "prog-c", "sTopic" : "The C Programming Language",
 "aChapters" : [
    [ "prog-c-books-references", "Books and References on C" ], // (An existing chapter & section).
    [ "prog-c-my-example-topic", "The Name of My Example Topic" ], // Your contribution.
   ]
} );

Your chapter should also have at least one resource inside of it.

Topics

Topics need their own dTopics entry and at least one new chapter (and section), containing one new resource. In addition to all of these modifications to db-init.js, this data needs to become accessible. This requires a modification to index.php where the menu is contained. This requires only a single line of HTML in the right spot.

<li><a href="#" to="prog-intro">Intro to Programming</a></li>

Generally this would be added with other <li> elements in their shared submenu <ul> tag.

Clone this wiki locally