a quick HOWTO for getting more infoblocks on the front page a quick HOWTO for getting more infoblocks on the front page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

a quick HOWTO for getting more infoblocks on the front page

Started by azrael, October 23, 2003, 05:49:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

azrael

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.

cangssithra

i got problem putting the search block on the main page. I replace the anycontent.php to search.php but it won't work.

Joachim Müller


Jaero

When I try this (exactly what is said) - I get
QuoteParse error: parse error, expecting `']'' in /home/web/me/content/fanart/index.php on line 92
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com