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

Templates und modularer Aufbau bzw. Abhängigkeiten

 
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: Mon Dec 17, 2012 7:14 am    Post subject: Templates und modularer Aufbau bzw. Abhängigkeiten Reply with quote

Hallo Leute,

es ist nicht wirklich ein Smarty Problem.
Ich frage mich einfach nur, wie ich es mit Smarty umsetzen könnte.

Und zwar habe ich mir ein modular aufgebautes kleines Framework programmiert. Dort kann ich eigene Module ganz einfach integrieren.
Das klappt auch prima. Ich habe das bei einigen Projekten schon gesehen, wie diverse Forensysteme bei denen man per Klick ein Modul integrieren kann.

So nun zu meinem Problem.
Wie schafft man es nun, diese Module mit einem Template auszugeben, ohne dabei Abhängigkeiten zu erzeugen, wie es z.b. die Forensysteme schaffen.

Ein Beispiel:

Ich habe eine Seitennavigation.
Jetzt installiere ich Modul A welches einen neuen Menüpunkt einfügt.
Wenn ich nun Modul B installiere um einen weiteren Menüpunkt zu integrieren, müsste ich ja rein theoretisch, das Template überschreiben, dann wäre Menüpunkt A weg. Somit ist das ganze modulare System für die Katz.

Wisst Ihr was ich meine?
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Mon Dec 17, 2012 8:48 am    Post subject: Reply with quote

Wie wäre es denn mit Datenbank? Du könntest beim installieren einen neuen Menüpunkt erstellen, allerdings in der Datenbank sozusagen. Das "Eigentliche" Modul bezieht die Information aus der Datenbank udn zeigt die (alle) Menüpunkte an. Somit wird nichts überschrieben. Außerdem hast du das ganze dynamisch und nicht statisch, wie es bei dir der Fall ist (wie es ausschaut)
Back to top
View user's profile Send private message Visit poster's website
eazytrader
Smarty Rookie


Joined: 16 Jul 2010
Posts: 33

PostPosted: Tue Dec 18, 2012 12:11 pm    Post subject: Reply with quote

Das mit dem Menüpunkt war nur ein kleines Beispiel.
Wenn es nur die Menüpunkte wären, dann wäre es kein Problem.
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Wed Dec 19, 2012 7:45 am    Post subject: Reply with quote

Dann mach allgemein alles in Datenbanken...
Back to top
View user's profile Send private message Visit poster's website
eazytrader
Smarty Rookie


Joined: 16 Jul 2010
Posts: 33

PostPosted: Thu Dec 27, 2012 11:01 am    Post subject: Reply with quote

Ok, ich habe es herausgefunden.
Mybb macht es auch so. Das Templatesystem basiert dort komplett auf einer Datenbankstruktur.
Module werden so eingebunden, das eine bestimmte Stelle gesucht wird und das Modul an dieser eingebunden wird.

Ich habe mir über diese Art noch gar keine Gedanken gemacht.
Ich sehe aber gerade, es macht durchaus Sinn, das mit Smarty zu realisieren. Man kann ja auch Datenbank Resourcen einbinden.

Gruß und Danke
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