File Structure in Solodev
Solodev has a unique site structure that is designed for easily building efficient, well-organized websites. After your website has been setup in Solodev, two folders will automatically populate including:
- The www folder is where all of the site's pages are located.
- The web files folder is where all of the individual elements that make up those pages are located.
While it is entirely up to you how to name your files, a suggested way to do it is to have the www folder mirror your website's main navigation and your web files folder be made up of folders for content, navigation and templates.
Below is an example of a typical Solodev website structure:
Web Files Folder
The web files folder is the one that contains the elements that power your Solodev CMS website. It is typically structured in the manner shown below, with commonly used folders storing various website elements such as HTML and image content, datatable forms and managers, as well as navigational and layout templates for your site.
Although not required for your website to work in Solodev CMS, best practices suggest you build out your web files folders in this manner:
- Content - Used to store content (HTML files, images, text files, etc.)
- Forms - Used to store any datatables that power forms
- Modules - Used to store any managers related to your website(s) such as calendars (Events, Blog, News, etc.)
- Templates - Used to store the various templates that make up the structural foundation for the pages.
The WWW folder should reflect the site map. It should contain all of the root files of your website -- folders, .stml, assets, etc.
Generally speaking, the most important files in the WWW folder are your .stml files. These are your individual website files that are publicly visible and which get served up in a browser as a user visits your website.
These .stml files are built with templates that use Dynamic Divs. A template is used to import common elements to a page such as the header and footer. You then use the Dynamic Divs to include unique page content, such as specific text, images, sidebars, etc.
The Dynamic between the Web Files and WWW Folders
The web files and WWW folders mutually reinforce one another and help each other power the content, code, and pages that make up a website. As such, it is important to understand how these two folders are intended to work with one another.
As has been mentioned, the web files folder is generally used to store all of your website's component pieces. Create HTML files, upload images, create forms, create datatable managers, and house your site's template and theme assets.
The WWW folder includes various .stml files which are your visible web pages and are where all of your disparate components get assembled together and make a complete web page.
Below is the web files folder for the "home" folder:
As you can see, the folder contains several different elements including a template file for a news widget, a template file for an image slider, an .html document containing the base content for the page, and an images folder containing all the graphics that go on the page.
Below is the "index.stml" file which is under the WWW folder and corresponds to the homepage of a website.
The index.stml page is comprised of the base template (the header and footer) and contains a number of Dynamic Divs. As in the example here, the Dynamic Divs are filled with the various elements from the corresponding "home" folder under the web files folder.
Most pages should follow this basic relationship, where content and page elements are under the web files folder and the WWW file contains .stml files that puts its all together.