Categories > TinyButStrong general >

Displaying tbs blocks and static html

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Brandon
Date: 2006-08-17
Time: 18:34

Displaying tbs blocks and static html

I have an index.php file that implements tbs to fill in some dynamic content and and some static content as well.  Goto shadygrove.ca to see it.

So far the only ways I have found to display it all in the correct order are 1. to place the static content in include files which I copy into the page when index.php is executed, in the correct order using the LoadTemplate method

OR

implement the first part of the page using tbs methods, ending with a show, then display the static content, then make a new tbs object, populate it and use show to display.

I do not believe either of these is the right way to do it.

What is the correct way.  If I just have static content, it ends up displayed before any of the tbs output, out of my desired order..
By: NeverPanic
Date: 2006-08-17
Time: 19:26

Re: Displaying tbs blocks and static html

Add the static content in the right place to the template or load it via [script=...] or [file=...] into the template during execution.
By: Brandon
Date: 2006-08-17
Time: 20:05

Re: Displaying tbs blocks and static html

Putting it in the correct place results in it being rencered at the top of the page, not in the correct place.
By: Brandon
Date: 2006-08-17
Time: 20:15

Re: Displaying tbs blocks and static html

To clarify, here is part of the index.php file.  The tagged paragraph appears at the top of the rendered page.  It never changes and should be part of the index.php file, IMO:

$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/header.html') ;

$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/announcementBlock.html', '+') ;
$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/listBlock.html', '+') ;

<p>
    We have very special musicians in to play for a small audience.  We post our schedule here and invite you to <a target=_blank href="./email.shtml">send us a message</a> if you want more information or see a concert you wish to attend.  You can also call 483-5435 for reservations and directions.  We serve refreshments at intermission time, handmade for an enjoyable experience.
</p>

$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/detailBlock.html', '+') ;
$TBS->MergeBlock('announcementBlock',$cnx_id,'SELECT * FROM announcements  ORDER BY listOrder') ;
$TBS->MergeBlock('listTable',$cnx_id,'SELECT * FROM concerts where status="C" ORDER BY concertDate') ;
$TBS->MergeBlock('detailTable',$cnx_id,'SELECT * FROM concerts where status="C" ORDER BY concertDate') ;
mysql_close($cnx_id) ;
$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php', '+') ;
$TBS->Show(TBS_OUTPUT) ;
?>
By: Anonymous
Date: 2006-08-17
Time: 20:17

Re: Displaying tbs blocks and static html

Sorry - I pasted the wrong snippet, missing the ehd php and begin php delimiters:

$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/header.html') ;

$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/announcementBlock.html', '+') ;
$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/listBlock.html', '+') ;
?>
<p>
    We have very special musicians in to play for a small audience.  We post our schedule here and invite you to <a target=_blank href="./email.shtml">send us a message</a> if you want more information or see a concert you wish to attend.  You can also call 483-5435 for reservations and directions.  We serve refreshments at intermission time, handmade for an enjoyable experience.
</p>
<?
$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/detailBlock.html', '+') ;
$TBS->MergeBlock('announcementBlock',$cnx_id,'SELECT * FROM announcements  ORDER BY listOrder') ;
$TBS->MergeBlock('listTable',$cnx_id,'SELECT * FROM concerts where status="C" ORDER BY concertDate') ;
$TBS->MergeBlock('detailTable',$cnx_id,'SELECT * FROM concerts where status="C" ORDER BY concertDate') ;
mysql_close($cnx_id) ;
$TBS->LoadTemplate($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php', '+') ;
$TBS->Show(TBS_OUTPUT) ;
?>