Categories > TinyButStrong general >

Render Template Portion

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Michaelsen
Date: 2011-06-23
Time: 19:33

Render Template Portion

Mr Skrol29,

Hello sir, perhaps this is a long shot, but, is it possible for TBS to render just a portion of a template?

For example, could it render just what is inside a div based on its id?

<div id="content">
<!-- render only whats inside here -->
</div>

I'm asking you this because I used for the first time some ajaxes and noticed I would have to change plenty stuff related to the current easiness I have with tbs world. One thing I know for sure, I'm not going back to echo $_POST sad days.

Regards,

- Michaelsen
By: Skrol29
Date: 2011-06-24
Time: 23:25

Re: Render Template Portion

Hi Michaelsen,

Yes, there is a way to reduce the content of a template to a sub-part.
This can be done using the GetBlockSource() methode, like this:

HTML:
<div id="content">
  [render;block=div]
  <!-- render only whats inside here -->
  ...
</div>
or:
[render;block=begin]
<!-- render only whats inside here -->
...
[render;block=end]
PHP:
$TBS->Source = $TBS->GetBlockSource('render', false, false);
By: Michaelsen
Date: 2011-06-27
Time: 00:03

Re: Render Template Portion


Very impressive, as always.

Thank you for the reply!

Please keep up the good work!

- Michaelsen