Saw someone earlier ask how they would get more blocks on the
mainpage of CM. I spent a little time poking into some of the files and
discovered how, and thus want to share that little trick with others who
might wonder how to do the same.
In the manual at
http://yourcmsite/docs theres a little section that
exlains how to change which regions on the front page.
As an example is used the sample anycontent who points to
anycontent.php in the root dir of your CM site. The name anycontent
is a variable that is declared in the index.php file and looks like this:
case 'anycontent':
if ($cat == 0) {
include('anycontent.php');
}
flush();
break;
Lets say you wanted to use two sections, one at to and one at bottom as
your own custom header and footer, simply remove or name the
anycontent label and replace it with what you want to name it, for
instance like this:
case 'headerblock':
if ($cat == 0) {
include('headerblock.php');
}
flush();
break;
case 'footerblock':
if ($cat == 0) {
include('footerblock.php');
}
flush();
break;
This will make two variables name headerblock and footerblock which
points to their respective files as an include statement.
Now to get things shown properly we need to get the CM to actually use
them, this is done through the regular confugre section in CM.
Under album list view, theres a section named "The content of the
mainpage". Here you place the variables you made in the index.php file.
In my case it looks like this:
headerblock/catlist/alblist/random,2/topn,2/toprated/footerblock.
This will display first the contents of headerblock.php, then the catergory
list, the albumlist,2 rows of random images, 2 rows of most viewed
pictures, 1 row of the most top rated pictures and finally the contents of
the footerblock.php
Hope this is useful for someone
--
Az.