By: goldkante
Date: 2008-04-15
Time: 17:00
|
caching of subtemplateshello!
i have one main-template where some othe scripts are included in "subtpl"-mode. example:
everything's orking pretty good so far. the included script's are lookin pretty much like this:
everythings's working fine, too! output is generated and is looking fine. if the cache-file of the subtemplate is deleted, the fresh content is generated and displayed properly. my problem starts on the next refresh, when the content is loaded from cache: the cache-file of my suddenly contains the content of the next included script. in this case the content of .tmpl_start_national_international. i don't have a clue whats wrong... thanks in advance for your help!! |
|||
By: TomH
Date: 2008-04-15
Time: 19:36
|
Re: caching of subtemplatesHello,
I think it's your IF statement syntax... Here's how I do it
Hope that helps, TomH |
|||
By: goldkante
Date: 2008-04-15
Time: 19:58
|
Re: caching of subtemplateshi tom!
problem stays the same. if _one_ of the subtemplate cachefiles is delete, the the output of the next included script ist found in it, on the next refresh. if i delete all cached subtemplate files, everythings fine. every cachefile is filled with the correct content. maybe this is something about the $TBS->render property. just guessing... actually i dont have a clue. so far everthings so fine about tbs... i would be so sorry if the caching wouldnt work this way. |
|||
By: TomH
Date: 2008-04-15
Time: 21:35
|
Re: caching of subtemplatesI may have been unclear... my caching (as shown above) is done in the main page NOT in the subscript
When I cache in the subscript I do a new instance of TBS and I do NO TBS->Render
|
|||
By: goldkante
Date: 2008-04-15
Time: 22:03
|
Re: caching of subtemplateshmmm... im confused :)
if i start a new instance of TBS inside a subscript, the only thing displayed is the template loaded inside the subscript... no matter if its cached or fresh content. i try to eyplain the whole scenario a little more, maybe the whole construction is too complicated and you can give me a hint for building a better, simpler one. in my index.php, which is executed first, i have loaded a template called "main.container.startpage.html". in this template i include several scripts using [onload;script=[var.tmpl_start_somescript];subtpl] for example. inside those included scripts i load content fron the db, merge blocks and render cachefiles, display them or just display them, depending on the "freshness" of the content. in some cases, i need to load an other script using [onload;script=[var.tmpl_start_someotherscript];subtpl]... as you can see, in this situation im in a "sub-sub-script"-mode. maybe thats is the problem. |
|||
By: TomH
Date: 2008-04-15
Time: 22:26
|
Re: caching of subtemplatesHmmm,
(1) read the full thread at http://www.tinybutstrong.com/forum.php?msg_id=3842 (slowly and carefully) (2) then make sure your instances ($TBS->... and $this->...) mirror that architecture are used appropriately If that doesn't help then post your COMPLETE main php and html and one set of subtpl php and html codes - as a debugging case. We'll have to work on the sub-sub- issue on the second pass ;) |
|||
By: goldkante
Date: 2008-04-15
Time: 23:37
|
Re: caching of subtemplateserm... as i can see in http://www.tinybutstrong.com/forum.php?msg_id=3842,
everythings just like in my scenario... but i doesnt work. lets give this debugging-attempt a try: main.php
this is the template:
an finaly one of those nasty subscripts.
now you can see one example... all other subscripts have exactly the same structure... and thank you so much for giving it a try! :) |
|||
By: goldkante
Date: 2008-04-15
Time: 23:48
|
Re: caching of subtemplatesone thing: if the cachetime is exceeded and all the cachefiles are refreshed at once /all have a global cache ttl), everythings working fine. if i delete just the cached output generated by the subcript i posted,
the content of this cachefile is replaced by the next _not_ cached output. in this case its the footer navigation. as a result of this, insted of the "users online" list the footer navi ist displayed on this position. |
|||
By: goldkante
Date: 2008-04-16
Time: 00:22
|
Re: caching of subtemplatesanother thing i dont unserstand:
why is
|
|||
By: TomH
Date: 2008-04-16
Time: 00:31
|
Re: caching of subtemplatesSorry to have miscommunicated...
I meant that you needed to construct a test case based on the model of that thread i.e. to have a new/separate instance of TBS for the subtpl script I can't do that for you - as only you have the db's with which to plug the merges. It's my hunch that the global instance being used in the subtpl (from the main file) is the underlying source of the problem (and will rear it's ugly head again in the sub-subtpl case) |
|||
By: TomH
Date: 2008-04-16
Time: 00:32
|
Re: caching of subtemplatesWhat version of TBS are you running?
|
|||
By: TomH
Date: 2008-04-16
Time: 00:33
|
Re: caching of subtemplatesI missed that "!" in the second method .
Maybe that's it? |
|||
By: goldkante
Date: 2008-04-16
Time: 00:41
|
Re: caching of subtemplatesim getting a bit tired now. forget about the (!)... i forgot to delete it.
why is one working while the other is not? all the examples and tutorials are working with CacheAction... even if it doesnt semm to be my problem, i'd like to know. btw. im working with 3.3.0... |
|||
By: goldkante
Date: 2008-04-16
Time: 01:14
|
Re: caching of subtemplatesi found the soulution:
just started a new instance in main.php and everythings working fine!!! thanks for your help and thanks to skrol for this great engine!! |
|||
By: goldkante
Date: 2008-04-16
Time: 01:42
|
Re: caching of subtemplatesoh my... it doesnt work. the new instance just used the my rootdir for caching.
so teh che wasn't deleted properly... i'm too tired right now. i'll give it another try tomorrow... :( |