Categories > TinyButStrong general >


The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: jabowery
Date: 2012-09-15
Time: 03:10


Being a newbie to TBS, I don't know how to eliminate duplicate HTML that appears in two templates.  You know "Don't Repeat Yourself".  There is no "include" directive that I can see (other than at the PHP level).  The writeups on nested templates look like they violate encapsulation by requiring the PHP script to know about all of the entities that will be used by the templates it uses.

What I want is simple:  take the duplicate HTML out of the two files and make one file with that content -- and then re-include it in those template files without having to change the calling PHP.

I must be missing something obvious.
By: Skrol29
Date: 2012-09-15
Time: 21:56

Re: DRY?

Can you post some template parts, and PHP parts?
By: jabowery
Date: 2012-09-20
Time: 00:44

Re: DRY?

a.html contains:

b.html contains:

c.html contains:

When I render template a.html I want it to say:
Hello world!

When I render template b.html I want it to say:
Hi world!

I don't want to reference c.html anywhere but within a.html and b.html
By: kle_py
Date: 2012-09-27
Time: 16:59

Re: DRY?

Maybe Your solution is as simple as to modify a.html and b.html.

Hello [onload;file=c.htm]
Similar for b.html.

Maybe this is what You are looking for ?
See also