WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: sandbflag on August 18, 2008, 04:14:11 PM

Title: Internet Corporation --- Making "Site News" Unique to each page
Post by: sandbflag on August 18, 2008, 04:14:11 PM
What would be the best way to make the site news section on the Internet Corporation template different on each page in the site?  Thanks for your time
Title: Re: Internet Corporation --- Making "Site News" Unique to each page
Post by: aldus on August 18, 2008, 04:22:32 PM
I'm a little bit sorry: but i can't understand this, or did you mean:
on the main-page left-top, on every other page, left-button ...
or realy on every page another place ...

one way could be to use two diff css for the div "left" and "left_subpage" and modify line 37 in the template like
Code: [Select]
<div id="left<? echo PAGE_ID == 1 ? "": "_subpage"; ?>">

So you only have to modify/add the css-rule for the new position of the news in the style.css

Edit:
Another way could be to use switch for differ groups of pages and add differ styles for
repositioning like:
Code: [Select]
<?php
/**
*    The page news are placed on differ places,
*    than on the main-page.
*    
*    @version    0.2.0
*    @date        2008-08-18
*    @author        aldus
*    @state        @dev
*
*    @notice        Maybe you need to modify the first line if your
*                main-page havn&#39;t got the ID 1, e.g. 27 ...
*
*/
    
switch (PAGE_ID) {
        case 
1:
            
$add "";
            break;
        
        case 
2:
        case 
3:
        case 
7:
        case 
14:
            
$add "_math_groupe";
            break;
            
        case 
9:
        case 
12:
        case 
32:
            
$add "_geo_groupe";
            break;
            
        default:
            
$add "_sub_groupe";
    }
    echo 
"<div id=\"left"$add ."\">\n";
    
page_content(2); 
    echo 
"</div>\n";
?>



Regards
aldus