TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Use two templates in a block as per the flag values

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Unni R
Date: 2013-07-29
Time: 10:15

Use two templates in a block as per the flag values

Hi,

Can we use two html snippets(templates) in a single block as per  the flag values in the block array.

Array has the values  name, age, sex, date of registration.

I need to make a listing display from these array.

I have two separate templates for men and women.

How can i make a list from this array.. The order of listing need to be on the basis of date of registration.

Is this possible?

Please help me...
By: Skrol29
Date: 2013-07-31
Time: 11:22

Re: Use two templates in a block as per the flag values

Can you illustrate with an example.
By: Unni
Date: 2013-07-31
Time: 11:38

Re: Use two templates in a block as per the flag values

Example

In my DB  -- table user_details-- records are as follows:

1. Reema  32  female  21/07/2013
2. Alex   28  male 23/07/2013
3. Mercy  21 female  24/07/2013

I have two html snippets ( one for male and other for female)... female snippet is different from the male in look and style.

I need to make a listing of these users data in a web page

so here the listing should be:

1. Reema  32  female  21/07/2013  <=  shows in  female snippet

2. Alex   28  male 23/07/2013<=  shows in  male snippet

3. Mercy  21 female  24/07/2013<=  shows in  female snippet

Is this possible with TBS module?

Thanks
By: Skrol29
Date: 2013-08-20
Time: 23:30

Re: Use two templates in a block as per the flag values

Hi Unni,

The best way fr this is to use conditional section of blocks.
http://www.tinybutstrong.com/manual.php#html_conditional

One conditional section is the row styled for females, and the second one is the row styled for male.