I turned on Advanced Permissions in concrete5 and for a certain user group I got the error message:
Unable to access the file manager.
I tried to fix this by going to the Dashboard > Site Map > Turn on system pages > Dashboard > File Manager and giving permission to my group, but this did not work.
Instead, I had to go to:
Dashboard > System and Settings > Permissions and Access > File Mananger Permissions.
Press the "Add Group" button.
Add your user group.
You can add your own custom attributes (for example, name and address) to a user.
First you have to turn on Public Registration (it’s off by default)
Dashboard > System and Settings > Login and Registration > Public Registration
Under “Allow Visitors to Signup as Members” select “On – email validation” (You can choose the other options but this one has been recommend to me, so this is the one I chose).
Dashboard > Members > Attributes
Select or create new attributes and then check “Show on Registration Form“.
Checking this box tells Concrete5 to put this on the registration form. Specifically, in the file:
– under the methond named do_register():
$aks = UserAttributeKey::getRegistrationList();
getRegistrationList() gets all of the attributes which have “Show on Registration Form” checked. If the user filled out that field, then it gets added as a User Attribute.
There are a few posts on how to make a custom registration page so I won’t go into detail about that.
Under the controllers folder (your controllers folder, not the concrete/controllers folder) create a file called sample.php.This is your controller file.
Under the single_pages folder create a file called sample.php. This is your view file.
Then go to the Dashboard > Pages and Themes > Single Pages and create a file called sample.
Single pages usually default to view.php, and any content you place in say, single_pages/sample.php will show up where you place:
This bit of code goes into your view.php file (in your theme folder) where you want to place the content from your view (in your single_pages folder…in this case, the file called sample.php which is in the single_pages folder).
Alternately, you can create a template with the same name as the controller and view (in this case, sample.php) drop that file into your theme folder, and that will work too (instead of using view.php). This gives you the chance to customize the look and feel a bit more.
Go to Dashboard > Sitemap and find your page (sample).
Go to view the page and add a form block.
Add some questions to the block and then click “Add”. Once you are done, view the HTML source of the form.
Your inputs will look like:
<input type="text" name="QuestionNumber" value="">
Where I wrote “QuestionNumber” it’s usually a number like “Question24” or “Question8”. Write these down for the inputs you want to pre-fill.
Remember, “special thing” gets passed to the view from the controller by:
Easier than trying to override the form block.
The following line will give you the path to your theme:
<?php $this->getThemePath(); ?>
And this line will give you the link to your stylesheet (in this case, “typography.css”):
<?php $this->getStyleSheet('typography.css'); ?>
Keep in mind that concrete5 controls the following when you write:
<?php Loader::element('header_required'); ?>
Elements controlled by concrete5:
– apple icon
– the title tag and it’s content
Below is a work-in-progress checklist of things I do when setting up a Concrete5 site.
The unzipped files for Concrete5 clock in at around 31MB which is a super-big upload, so it’s easier to just upload the zip file and SSH to the site to unzip it:
Dashboard > System and Settings > SEO And Statistics > Enable Pretty URLS
The Dashboard has background images which are pulled from the Concrete5 site. I personally don’t mind how these images look, however, if you are working locally off your computer it can be a bit of a pain if your internet access goes down (because Concrete5 will keep trying to get the images from the Concrete5 site).
Dashboard > System and Settings > Interface Preferences
Background image > set to none.
I like to disable the Quick Navigation Bar because I find the way it appears when I hover over the Navigation bar a bit hard to manage.
Config > site.php
<?php define('PERMISSIONS_MODEL', 'advanced'); ?>
So far, to me it seems easiest to set Permissions by “Page Type Defaults”. Then, under each Page Type Default, I set it “Manually”. There’s probably a better way to this however.
The site.php file contains your database information, so to make it more secure set the file to 644 (usually it’s set to this after installation, so this is more of a check).
Go to Config > then select or create a file called site_process.php.
Say you have a group called, well, “Awful Designers” that you would like to not have Design mode:
$user = new User();
$group = Group::getByName('Awful Designers');
This hides everything except for the front page unless someone is a user and logged into the site.
Dashboard > System and Settings > Permissions and Access > Maintenance Mode
Note: I have had issues with maintenance mode. For example, I can’t seem to add custom attributes to a page when a site is in maintenance mode. If you are having problems like this, it’s probably because maintenance mode is on.
Dashboard > System and Settings > Cache and Speed settings > Basic Cache > Off
When you are developing your site, you sometimes won’t see your changes due to the Basic Cache being on. Turning this off during development will help you with this issue.
Add the following to your config > site.php file:
This turns off “checking for updates” and also any news items (the news that pops up when you log in). Even if you are working from a local server, Concrete5 will (if you don’t add this) keep checking the concrete5.org site for news and updates, which can be a bit of a hassle.
For further reference, refer to the white labelling support.
Designer Content. While it’s worthwhile to learn to create your own block, this addon keeps a lot of the great UI that’s built into concrete5 (for example, the image cropping tool and the link creation tool is built in).
Manual Nav. The Auto-nav block that comes with concrete5 is great but I find this one is actually a bit easier to use (which I am guessing means clients will find it easier to use too. Which means they will call you less).
Concrete5 has a magic method in the PageList Class that allows you to “grab” a list of pages by a custom page attribute.
For example, if you have custom (Boolean) attribute called “event_section”:
And that custom attribute is added to any page as “true” (by checking the checkbox):
You can, by using this magic method, grab all pages that have this custom attribute.
In this example, the attribute is called “event_section” so the magic method will be named:
Remove the underscore, and capitalize the words divided by the underscore (i.e. “EventSection”).
$eventSectionList = new PageList();
This now gives you a variable ($eventSectionList) that is a list of all pages with the custom attribute “event_section” checked.
To “get” all the sections, use the <strong>get()</strong> method:
$tmpSections = $eventSectionList->get();