Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem beim Cachen dynamischer Seiten

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
eazytrader
Smarty Rookie


Joined: 16 Jul 2010
Posts: 33

PostPosted: Wed Jul 16, 2014 7:46 am    Post subject: Problem beim Cachen dynamischer Seiten Reply with quote

Hallo Leute,

ich will meine Seiten Cachen.
Nun habe ich die Option aktiviert und das Verzeichnis angegeben, welches auch genutzt wird. Jedoch wird immer das gleiche Template angezeigt.

Z.b. rufe ich die Seiten so auf:

index.php?content=1
index.php?content=2
index.php?content=3
usw.

Im Template selber werden dann die INhalte dynamisch geladen.
Jetzt wird leider nur immer dieselbe Seite angezeigt.

Was mache ich falsch?

Gruß und Danke.
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Wed Jul 16, 2014 9:35 am    Post subject: Reply with quote

Du musst einen anderen "CachingKey" nehmen.

Code:


$content = $_GET["content"];
$cacheKey = "Content_".$content;
if(!$smarty->isCached("index.tpl", $cacheKey ))
{
//Hier den Dynamischen Inhalt "laden"
}

$smarty->display("index.tpl", $cacheKey);



Mit

Code:

$smarty->clearCache("index.tpl", $cacheKey);


kannst du den Cache leeren.

ACHTUNG: Wenn du z. B. eine eigenes Template für die Top Navigation hast in dem auch immer der "aktuelle Seite markieren" gewählt wird oder ähnliches, musst ggf. in den jeweiligen Template vor dem laden folgendes machen:

Code:

$smarty->caching = false;


und danach, wenn es gebraucht wird, wieder auf true.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP