Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

December 06, 2022, 07:57:34 AM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193627
  • Total Topics: 21108
  • Online today: 101
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 80
Total: 80

Author Topic: Add the blocks to a page  (Read 2280 times)

0 Members and 1 Guest are viewing this topic.

gelsbern

  • Guest
Add the blocks to a page
« on: August 22, 2005, 11:28:47 PM »
I have a page that I want to include in my site, and I want to have it load all the blocks like the front page, is there an easy way to do this?  It is php and I have it running through index.php with the action=,  and it shows the top bar just fine but for some reason I cannot find where to tell it to display the left and right blocks. 
« Last Edit: August 22, 2005, 11:38:51 PM by gelsbern »

gelsbern

  • Guest
Re: Add the blocks to a page
« Reply #1 on: August 23, 2005, 09:33:03 AM »
Here's my template.   It shows the top but not the centerbar or right or left bars, and really I just want the right an left bars so what do I need to add to my template. 

<?php



function template_main()
{
        global $modSettings, $scripturl, $context, $settings, $options, $txt;
        $local_settingvar = "htmlpage_Content" . $_REQUEST['htmlpage'];
        $local_htmlContent = $modSettings[$local_settingvar];

        // Display the content
        if (!empty($local_htmlContent)) {
                                echo eval('?' . '>'. $local_htmlContent);
       
        }
}

?>

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Add the blocks to a page
« Reply #2 on: August 23, 2005, 11:32:34 AM »
I'm no php expert, but you can look at the tportal.mod file in the tiny portal mod and you can see what is added to the index.template.php file. I believe those are the lines you'll need to include the columns. But, as I said I'm no expert coder. :) Hopefully that will change with time.

Bjørn

  • Guest
Re: Add the blocks to a page
« Reply #3 on: August 23, 2005, 12:11:02 PM »
you need 2 things. first to include the block template and then to call the left/right/center finction. Including is done like this:

           loadtemplate('TPortalBlocks');

Which must be put before any html out put, before the echo statement.

Then you need to call the bars to start render themselves...this basically needs a table, so they will go on either side..if we use your example it should be like this(i haven't tested this ):
Code: [Select]
function template_main()
{
        global $modSettings, $scripturl, $context, $settings, $options, $txt;
        $local_settingvar = "htmlpage_Content" . $_REQUEST['htmlpage'];
        $local_htmlContent = $modSettings[$local_settingvar];

         require_once('SSI.php');
         loadtemplate('TPortalBlocks');

     // The main content should go here.  A table is used because IE 6 just can't handle a div.
        echo '<div id="bodyarea" style="padding: 10px 8px 0px 8px;">
            <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';
          if($context['TPortal']['leftbar'])
          {
              echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; background-color: #D4D4D4; padding-top: 4px;" valign="top">
                 <div id="leftbarHeader"', empty($options['collapse_leftbar']) ? '' : ' style="display: none;"', ' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 TPortal_sidebar('left');
              echo '</div></td>';
          }
        echo '<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;" id="bodyarea">';
        if($context['TPortal']['centerbar'])
                    echo '<div>' , TPortal_sidebar('center') , '</div> ';

        // Display the content
        if (!empty($local_htmlContent)) {
                                echo eval('?' . '>'. $local_htmlContent);

        }


        echo '</td>';

        if($context['TPortal']['rightbar']){
              echo '<td style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; background-color: #D4D4D4; padding-top: 4px;" valign="top" align="right">
                 <div id="rightbarHeader"', empty($options['collapse_rightbar']) ? '' : ' style="display: none;"', ' style="width: ' ,$context['TPortal']['rightbar_width'], 'px; text-align: left; padding-top: 5px;">';
              TPortal_sidebar('right');
              echo '</div></td>';
        }
        echo '</tr></table></div>';
}