Specify Custom Blocks in a Theme
Permalink
Hi,
Just started working with Concrete5. I purchased the superfish menu addon from the marketplace and now I want to specify that block at the top of my theme so that whenever a new page is created, it is at the top. How is this done? Is there a way to pick a specific block and require it automatically?
Just started working with Concrete5. I purchased the superfish menu addon from the marketplace and now I want to specify that block at the top of my theme so that whenever a new page is created, it is at the top. How is this done? Is there a way to pick a specific block and require it automatically?
Ok, that makes sense but now I realize that I do not think that I understand page types. I want to create 4 different page types: Home, Left Sidebar, Right Sidebar, and Full Width. Do I do this in the theme directory? I guess I don't understand what a page type corresponds to, is it a PHP file in the theme directory or not in the theme directory at all?
When I package a theme, can it include a list of page types or do those need to be created through the dashboard interface? I wish that the theme creation walkthrough was a lot more detailed because it leaves you hanging a little with the more advanced functionality that is needed with a site. Of course I might be dumb, or I might be trying to understand a page type within the concepts of other CMS's that I have used and that might be my problem.
When I package a theme, can it include a list of page types or do those need to be created through the dashboard interface? I wish that the theme creation walkthrough was a lot more detailed because it leaves you hanging a little with the more advanced functionality that is needed with a site. Of course I might be dumb, or I might be trying to understand a page type within the concepts of other CMS's that I have used and that might be my problem.
Ok, I answered my own question. I will publish what I figured out below, so that if someone else is confused like I was, it will hopefully become more clear.
Ok, here I go. A theme is a collection of page types. The minimum required page type that every theme must include is the "default.php" file. Concrete5 has also established a few standard page types that allow moving from one theme to another theme to be less painless. These are full, left_sidebar, and right_sidebar. That way, if you start out editing a site using Concrete5's "vanilla" theme and you want to change to another theme later on, if the new theme contains the standard page types, you won't loose the general formatting philosophy behind what you created initially. If a page used a sidebar on the left in vanilla, the sidebar will still be in the left in the new theme (this works as long as you name the files with the proper naming convention: right_sidebar.php, left_sidebar.php, full.php). It should also be noted that since every theme needs a default.php, one of page types should be named defaul.php rather than a more descriptive name, e.g. right_sidebar.php.
What I did not understand was how to create a new page type. To create a new page type, simple add a new php file into the theme directory, give it a name, and upload it to the server. Once it is in the theme file, Concrete5 will be able to see it. If you have already activated the theme on the site and you wish to add an additional page type, upload the file, log into the dashboard, and go to Pages and Themes. Once there, click the INSPECT button and Concrete5 will display all of the page types in use by the theme. If Concrete5 finds a new file, it asks you (with a checkbox) if you wish to create a new page type with that file. If you do, click the "Activate Files" button and the new page type will appear in the page type area thus allowing you to edit it, define an icon, etc.
What I did not understand was how to create a new page type. To create a new page type, simple add a new php file into the theme directory, give it a name, and upload it to the server. Once it is in the theme file, Concrete5 will be able to see it. If you have already activated the theme on the site and you wish to add an additional page type, upload the file, log into the dashboard, and go to Pages and Themes. Once there, click the INSPECT button and Concrete5 will display all of the page types in use by the theme. If Concrete5 finds a new file, it asks you (with a checkbox) if you wish to create a new page type with that file. If you do, click the "Activate Files" button and the new page type will appear in the page type area thus allowing you to edit it, define an icon, etc.
http://www.concrete5.org/help/editing/scrapbook_defaults/...