We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    Garry and I have been working to finalize plans for our repository and have a couple ideas we would like some input on before we started the major coding parts.

    Let me give you some background before the questions. We are planning on using a modified version of the filecabinet snippet to manage the uploading of files for the repository. If you have not seen this snippet it displays a form where the user can input all of the information about the item and the file associated with it. When the form is submitted a document is create in the modx tree to display all of the information to the users for download. Each item is stored in a folder that so they can be groupped together.

    Here is how our modified version of filecabinet will work:

    When a user uploads a new item a folder will be created in the doc tree with the item name.
    A document will be created inside the folder containing version information.

    When a new release is ready, a document will be added to the original folder with new update text and the new files.

    There will also be an upload area for additional resources, these could include language files, instructions, mods not in the official release, etc... These will also be stored as documents under the items folder.

    Here is a list of things we are planning on storing with each item:

    Resource Name
    Contributer Name (from SMF)
    Version #
    Content Tags
    Brief Description
    Description/Features
    Instructions
    Example Usage (snippets)
    Download Count
    Rating
    Core Team Audited
    Release/Resource
    Addl. Resource Type
    Updates (for new release only)
    Featured Item
    Liscense

    This is where we started to have some questions. Basicly our main question was how to store the content (the structure outside of each item) to make it easily accessible, easily maintainable, and provide a lot of flexibility. Here are the three options we are looking at to store the items:

    1. All of the items are stored in a single folder (i.e. repository->item1->release1) and we have a tv to store the type (module,plugin,snippet) this could be multi select incase it invloves more than one of these. We would also have tags on each item that would allow for searching by functionality.

    2. We come up with some default categories (i.e. Navigation,Administration, ecommerce) and those are the folders items will be
    split into. Then we have a tv to store the type (module,plugin,snippet) and one for tags (the tags would be things
    other than our main categories for finer searching)

    3. We stick with our original plan and have a folder for each type (i.e. snippets, modules, plugins, site templates, etc...). We would still use the tags to allow for functionality searching as well.

    Of the above ideas what do you think sounds best?


    Here are a couple of lists that we could add to if anyone has suggestions:

    The additional resource types:
    Modification
    Language File
    Documentation
    Style Code (CSS)
    Image

    These categories are for all additional resources uploaded for a particular item.


    Tags - To give us better control we were thinking of having a pre-determined list of tags to mark each item with. This would be a multi-select and would allow us to set up filtering by functionality. Here is a preliminary list of tags. Any additions/deletions are welcome:

    Menu
    Search
    Blogging
    Imaging
    Gallery
    News
    Feeds
    Navigation
    File Management
    Streaming
    3rd Party Addon
    Style
    CSS
    Internationalization
    Language
    Ecommerce
    Administration
    Manager
    Editing
    Communication
    User Management
    Taxonomy
    Advertising
    Tracking
    Calendar
    Forms
    Multimedia


    One last question. What should we call each item uploaded, maybe something catchy that goes with modx?


    So that is kind of where we are right now. We are hoping to start coding this weekend and during next week!

    If you have any questions or suggestions post away

    Kyle
      • 25663 MODX Staff
      • 12,272 Posts
      Guys thanks for taking the reigns on this one. smiley

      I really don’t like the thought of categorizing by the type of resource (snippet/chunk/template/module/plugin), but I do by function. People shouldn’t have to dig through resource types in order to find a solution to their functional issue.

      For the structure, I’m a fan of making two folders... one for main "distributions" of the resource and one for hacks/addditions/etc. Each subsequent version could then be the main download link, with prior versions also available.

      E.g., (folders in bold):

      Menus & Navigation
      DropMenu
      version 1.0
      version 1.1
      ...
      Extras
      Add class to here LI
      Cool functional tutorial
      Brazilian Portuguese translation
      Hack to make it work like "blah"
      Call and CSS template to mimic Alistapart.com

      We might consider having comments on each item, but I’m not sure. Each top-level item (DropMenu, above) should probably spawn a new discussion item in our forums as well (we’re running RC2) for support discussions. If there’s lots of discussions, they probably could be manually added as references after the fact on the manager side.

      When it’s all done, Marc’s tag cloud will be cool to see!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 18397
        • 3,250 Posts
        Sounds awesome! I agree with Ryan that we should categorize based on function but we should still make the creator choose which type it is. That way we can create an advanced search box so a user can say find me all manager plugins relating to xyz. Also, tagging sounds awesome. If you need some sample code, let me know. I just about have free tagging working in Ditto.
          • 15987
          • 786 Posts
          Mark,
          I would love to see what you have planned for tagging, if we could use the same code it could definatly make getting that part setup easier. If you could send Garry and I, a pm or email with some info that would be great.

          We are definatly going to have everything listed by functionality.

          Anyone have any ideas on the list of categories we should use??

          Kyle
            • 25663 MODX Staff
            • 12,272 Posts
            Marc (MadeMyDay) already did a "tag-cloud-like" bit of code.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 18397
              • 3,250 Posts
              His code is nothing like what I am talking about. His code searchs the content and pulls out repeated words. My code works like delicious with free tagging.

              Here is the new filter function in Ditto that supports tagging (unreleased and names will change)

              <?php
              	function filterDocuments($resource, $filter) {
              		$filters = explode('|', $filter);
              		foreach ($filters AS $processfilter) {
              			$filterArray = explode(',', $processfilter);
              			$filterKey = $filterArray[0];
              			$filterName = $filterArray[1];
              			$filtertype = (isset ($filterArray[2])) ? $filterArray[2] : 1;
              			$tagDelimiter = (isset ($filterArray[3])) ? $filterArray[3] : " ";
              			$resources = $resource;
              			foreach ($resources as $k => $r) {
              				if (strpos($filtertype, "Tags") !== false) {
              					$documentTags = explode($tagDelimiter, $r[$filterKey]);
              					$filterTags = explode($tagDelimiter, $filterName);
              					$compare = array_intersect($filterTags, $documentTags);
              					$commonTags = count($compare);
              					$totalTags = count($filterTags);
              				}
              				$unset = 0;
              				switch ($filtertype) {
              					case "!=" :
              					case 1 :
              						if (!isset ($r[$filterKey]) || $r[$filterKey] != $filterName)
              							$unset = 1;
              						break;
              					case "=" :
              					case 2 :
              						if ($r[$filterKey] == $filterName)
              							$unset = 1;
              						break;
              					case "<" :
              					case 3 :
              						if ($r[$filterKey] < $filterName)
              							$unset = 1;
              						break;
              					case ">" :
              					case 4 :
              						if ($r[$filterKey] > $filterName)
              							$unset = 1;
              						break;
              					case "<=" :
              					case 5 :
              						if (!($r[$filterKey] < $filterName))
              							$unset = 1;
              						break;
              					case ">=" :
              					case 6 :
              						if (!($r[$filterKey] > $filterName))
              							$unset = 1;
              						break;
              					case "onlyAllTags" :
              					case 7 :
              						if ($commonTags != $totalTags)
              							$unset = 1;
              						break;
              					case "removeAllTags" :
              					case 8 :
              						if ($commonTags == $totalTags)
              							$unset = 1;
              						break;
              					case "onlyTags" :
              					case 9 :
              						if ($commonTags > $totalTags || $commonTags == 0)
              							$unset = 1;
              						break;
              					case "removeTags" :
              					case 10 :
              						if ($commonTags <= $totalTags && $commonTags != 0)
              							$unset = 1;
              						break;
              				}
              				if ($unset == 1)
              					unset ($resource[$k]);
              
              			}
              		}
              		return $resource;
              	}
              
              ?>
              
                • 15987
                • 786 Posts
                Mark,
                Thanks for the code. So are people going to create a tv for the free tags and then pass the value into the snippet call? I can see a lot of possibilities with this.

                Thanks,
                Kyle
                  • 18397
                  • 3,250 Posts
                  Yes, but I plan on having a &tags parameter so they don’t have to worry about the filter syntax.
                    • 15987
                    • 786 Posts
                    Quick question for all you marketing and design folks (or anyone else that has a good idea) ... we need to think of a good name for the repository and what we are going to call each item posted into the repository. If anyone has a good one feel free to post it here or pm Garry or I. If we get a good number of replys I can setup a poll or something to find the best one.

                    Thanks in advance,

                    Kyle
                      • 18397
                      • 3,250 Posts
                      Kyle, I started a thread on naming the templates section of the repository a while back. Here is the link:

                      http://modxcms.com/forums/index.php/topic,3059.0.html