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

id="you are here"

 
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
DabuLeader
Smarty n00b


Joined: 20 Jan 2005
Posts: 3

PostPosted: Wed Jan 26, 2005 7:17 am    Post subject: id="you are here" Reply with quote

Hallo Zusammen,

Aus der Datenbank generiere ich eine Menu. Dieses soll intelligent sein. D.h.
immer auf der aktuellen Seite soll ein id="you are here" stehen. Damit ich die aktuelle Position mit css formatieren kann.

<ul>
<li>Seite1</li>
<li id="you are here">Seite2</li>
<li>Seite3</li>
</ul>

die schlechteste aller lösung wäre {php}{/php} einzubauen. Gibt es noch eine bessere? Über ein Plugin?

Ist es überhaupt möglich das Menu einmal aus der Datenbank zu generiren, und erst danach die funktion you are here einzubauen.
Back to top
View user's profile Send private message
coach
Smarty Regular


Joined: 03 Jun 2004
Posts: 65

PostPosted: Thu Jan 27, 2005 4:35 pm    Post subject: Reply with quote

Hi,

wie generierst du das Menu? Im aufzurufenden PHP-Script oder mittels {include_php}?

Coach
Back to top
View user's profile Send private message
DabuLeader
Smarty n00b


Joined: 20 Jan 2005
Posts: 3

PostPosted: Fri Jan 28, 2005 6:40 am    Post subject: Reply with quote

Ich generiere es im php script.

Mittlerweile habe ich eine Lösung gefunden. Ich hole mir im php script das Menu. Übergebe das Menu an das tpl-file und eine Variable. Die Variable gibt an welches die aktuelle Seite ist. Im tpl-file mache ich eine {if} abfrage und vergleiche meine Variable. Bei gleichheit erscheint <li id="you are here">.

Das ganze tpl-file cache ich und die Datenbankabfrage im php script setzte ich in eine if(!$smarty->is_cached abfrage){datenbankabfrage}.

Könnte man das ganze auch in eine plugin funktion legen?
Back to top
View user's profile Send private message
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