Custom Sidebar only on the homepage - Page 2 Custom Sidebar only on the homepage - Page 2
 

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

Custom Sidebar only on the homepage

Started by allvip, October 09, 2013, 04:23:11 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

allvip

thanks a lot Niecher for the class ideea

allvip

I never would of thing to replace style="{CPG_MAIN_BLOCK_OUTER_STYLE} from Andre code with class="cpg_main_block_outer_style"
I'm so happy and greatfull for your help

thank youuuuuuuuuuu
was very important for my new theme

Αndré

I don't understand what you did, respectively why you did it that way. Your solution will return
    <div id="cpg_main_block_outer" class="cpg_main_block_outer_style">
    <div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>

on index.php. As you can see, you now have 2 cpg_main_block_outer blocks and I assume, only one of them get closed.


My idea was to use inline CSS instead of a new class and an additional div block. I.e. the token in
<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">
will be replaced the following way:
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }


I recommend to use that solution to get valid HTML code.

allvip

I think I don't understand where to put the code:

replace in template.html:


<div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>


with:


<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">


and add under function pageheader in theme.php:


    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }
every time I delete:
[code]
<div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>

I get the result from the attachment.
[/code]

Αndré

Please try to comprehend how this mod is supposed to work before randomly applying or replacing anything.

Here again the complete mod, expecting an unmodified gallery:

Open your theme's template.html file, find
<div id="cpg_main_block_outer">
(just this line!) and replace with
<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">

Now, open your theme's theme.php file and add the following code to the pageheader function:
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }

allvip

ok.it works perfect.thans a looooooooooooot.
boy I such and idiot

allvip


allvip

please delete all my 2 pages post
how will want to use your code will have to read 2 pages of wrong posts

Αndré

I just added a link to the solution to my second reply.

allvip