A minor update to add a global variable setting to toggle the menu item for the current page being formatted as a link.
New global variables now allow the user to select what sort of tags should enclose menu items, and what CSS classes to use. This makes it even easier to make FolderCMS work with the many generic HTML/CSS templates available online.
When an active menu item is not a link (because it refers to the current page), FolderCMS now encloses the text inside an inner span element, enabling more flexible styling.
GD-CMS has been renamed to FolderCMS, to better describe the system.
Documentation has been converted to HTML, in line with our new internal guidelines for documentation.
Copyright (c) 2010-2019 General Development Systems Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<?php echo 'Hello, world!'; ?>Now navigate to the location of that test file on the web, through your web browser (don't just open the file's location on your local computer or you'll just see what you typed into the file). If you see
Hello, world!by itself in your browser window, the PHP script has been executed correctly and done its job. But if you see the whole line of PHP code as you entered it into the file, PHP isn't working on your server.
<?php include('../files/foldercms.php'); ?>But replace ../files/foldercms.php with whatever the path to foldercms.php is on your server. Note that ../ means 'parent folder.'
$foldercms_content_path = '[path to a content directory]';This allows you to specify a custom path to your content directory. If omitted, the content directory is by default assumed to be named content and in the same directory as the foldercms.php file. (If you specify a custom path, it should be a full path on your server's filesystem, with / between each directory, and a trailing / at the end.
$foldercms_href_prefix = '[a URL prefix]';This allows you to specify a prefix for the menu links on your content pages. You won't need to worry about this unless you have specific requirements for how the links are formatted, or you use URL rewriting with all the content inside a virtual directory.
$foldercms_url_rewrite = TRUE;This option instructs FolderCMS to format menu links in a way that looks neater in the address bar. Instead of links like ?l1=Section&l2=subsection, FolderCMS will produce links like /Section/subsection. This won't allow FolderCMS to automatically recognise such links though. You'll still need to configure your server to translate the neat URLs into the ?l1=Section&l2=subsection style that FolderCMS expects.
$foldercms_url_space = '[a single character to represent spaces in URLs]'
By default, FolderCMS uses the standard convention of using the '+' character for representing+spaces+in+page+URLs. You can specify an alternative character, such as a '-', to-be-used-instead. In this case, it is still safe to have page titles containing '-' characters, since FolderCMS automatically substitutes them with '+' characters instead.
$foldercms_url_lowercase = TRUE;
This option instructs FolderCMS to generate the dynamic part of the URL in all-lowercase characters, which some people think looks neater in search results. There are no side-effects in how these URLs are interpreted (will not break existing links) as FolderCMS interprets URLs in a case-insensitive way.
$foldercms_double_encode = TRUE;Some versions of Apache (web server) will lose symbols like '+' in your page titles if you use URL rewriting on your site, breaking menu links that use those symbols. Enable this option as a workaround if you use URL rewriting and this happens to you.
$foldercms_auth_flags = 3; //...or, another example ... $foldercms_auth_flags = array(1, 3, 99);You can choose one or more numerical 'auth flags' to guard certain content with. For example, you might use the number 1 to guard pages that should only appear on the mobile version of your site, and number 5 for pages or categories that should only be available to users who have logged in to your website. (Note that adding user login functionality to your website requires extra PHP coding on your part.)
$foldercms_menu_tag = 'span'; //default setting $foldercms_menu_class = 'menuitem'; //default setting $foldercms_menu_active_class = 'menuactiveitem'; //default setting
By default, FolderCMS will wrap each menu item in a <span> tag, with CSS class specified as class="menuitem". The active menu item has an additional second class applied, which is menuactiveitem.
These can be used to style your menus using CSS rules. However, there are also many generic HTML/CSS templates available online which you might wish to use, and these might display menus using different CSS class names, or using <li> tags instead of spans. In this case, you can override FolderCMS's default settings by specifying the above definitions, but changing the values to be consistent with your template.
$foldercms_menu_current_page_link = FALSE; //default setting
By default, a menu item that refers to the current page &endash; the menu item explicitly selected by the user &endash; will not be formatted as a link, but as ordinary text. The exception is where the current page was displayed due to being the default page for a particular parent category, but was not explicitly selected by the user.
Since the defaut behaviour can make styling a page more complicated (the CSS rules for custom menu styling would need to accomodate active menu items that do and do not contain links), this behavior can be overridden by setting this global to TRUE.
Setting this variable to TRUE causes all menu items to be formatted as links regardless of whether active or not. The active items can still be styled accordingly by writing CSS rules for the menuactiveitem class which is described above.
<?php foldercms_place_title(); ?>anywhere you want the title of the current content page to appear. One good place is between the <title>...</title> in the head of the HTML code (so the correct page title appears in your web browser's title bar). Also place
<?php foldercms_place_content(); ?>where you want the body of the content to appear. For the menus, place
<?php foldercms_place_menu(1); ?>where you want the main (top-level) menu to appear, <?php foldercms_place_menu(2); ?> where you want the sub- (level 2) menu to appear, and so on. You can have as many levels of submenus as you like. By default, menus are generated with a space in between each menu items. You can have anything you want between each menu item, by supplying an optional parameter; for example...
<?php foldercms_place_menu(2, ' | '); ?>...will cause FolderCMS to separate | items | like | this.
<?php foldercms_place_template('[template title]'); ?>If a particular template file isn't available, this function simply has no effect. To add breadcrumb navigation to your site, use the following where you would like the breadcrumb navigation links to appear:
<?php foldercms_place_breadcrumbs('[separator]'); ?>...where [separator] is whatever symbol(s) or HTML code you want to appear between each link. To help promote FolderCMS, use the following near the bottom of your site to add a short 'Powered by FolderCMS' message to your page (you don't have to, but we do appreciate it):
<?php foldercms_place_promo(); ?>
<h1>Main heading</h1> <p/>First paragraph etc.
<?php foldercms_place_template('header'); ?>in the appropriate place in your index.php file. Cascading templates are only really needed if you have different layout requirements in different subcategories.
This function returns the title of the current page for use in PHP scripting, or takes an optional argument to return the title of the parent content at a different level, with 1 being the top level content in your website's content tree.