By: Shaps
Date: 2007-03-20
Time: 15:31
|
SubtemplatesHi,
I've a problem with subtemplate. I want to get the same result than PHP include function So I've a main page (index.php with index.tpl) in this page I've some links with a 'Cat' parameter: http://mysite/index.php?Cat=News. I want to include the News.tpl in the main.tpl. I've tried a lot of code to do this but still the same error: TinyButStrong Error in field [var.title_page...] : the PHP global variable named 'title_page' does not exist or is not set yet. This message can be cancelled using parameter 'noerr'. if I declare the $title_page in the index.php it seems to be ok but I don't want to write all the code in this page... What's the best way to get rid of this error?
|
|
By: TomH
Date: 2007-03-20
Time: 16:53
|
Re: SubtemplatesThere seems to be code missing to do what you ask... is this what you're trying to do...
Am I understanding yet? |
|
By: Shaps
Date: 2007-03-20
Time: 17:31
|
Re: SubtemplatesHi,
Yes this is what I'm trying to do but it doesn't work. I removed some part of code to clear the post but it's exactly what I want to do. I've tried your code and I get the same error... The subtemplate appears but the [var.page_title] is not replaced by the value... I think it's a very basic feature but I don't find the way to get the good result... Thanks for your comments |
|
By: TomH
Date: 2007-03-20
Time: 21:37
|
Re: SubtemplatesPlease take this in good spirit...
It seems that you are asking for us to read your mind on this... please just post the exact code, not pseudo-code, or we cannot help you debug without endless back-and-forth posts. |
|
By: Shaps
Date: 2007-03-21
Time: 09:45
|
Re: SubtemplatesOk,
Sorry for my first post. I've found a solution but I don't now if it's the best way to my problem. index.php
thanks for the support |
|
By: TomH
Date: 2007-03-21
Time: 13:42
|
Re: SubtemplatesLooks good to me.
I see you got a way to get the TBS instance to continue, that always catches me out a bit :) Some simplification might be done - probably not required...
Otherwise no help needed as far as I can see :) |
|
By: Shaps
Date: 2007-03-21
Time: 14:21
|
Re: SubtemplatesOk,
If I understand I always need to declare the template's var as global in my PHP code. What's wrong in getting the TBS instance to continue? Is there a better way? I read that multiple instance of TBS could reduce the performance... Thanks |
|
By: TomH
Date: 2007-03-21
Time: 14:49
|
Re: SubtemplatesI didn't mean something wrong -- just that I tend to forget to take care of that myself :)
|