Integrating theme functionality into modules
Posted: 05 July 2005 01:35 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  181
Joined  08-21-2003

If I want to enable the use of themes in modules that I am writing does the EE team have some example source code /  instructions in how to set this up?
If so that would be great as it would save quite some time of reverse engineering.
Many thanks

 Signature 

“In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.” - Douglas Adams, The Hitchhiker’s Guide to the Galaxy

Profile
 
 
Posted: 07 July 2005 08:03 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  181
Joined  08-21-2003

Well, Rick? Paul? Just some pointers would already be helpfull…

 Signature 

“In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.” - Douglas Adams, The Hitchhiker’s Guide to the Galaxy

Profile
 
 
Posted: 07 July 2005 11:32 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  122
Joined  01-20-2003

Do you mean forum themes? Or EE templates? Or just multiple themes for your module.

Now a complete EE theme module to apply to templates would be cool (and probably what you’re after).

Profile
 
 
Posted: 08 July 2005 02:24 AM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Well, this is kind of a doozy of a question.  Is your module going to have templates like those used for regular EE pages ({exp:weblog:entries}) or are you thinking more along of the themes used by the member and forum pages that are files that contain snippets of HTML and code?

 Signature 
Profile
 
 
Posted: 08 July 2005 02:29 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  181
Joined  08-21-2003

Exactly, what I want is to have a theme structure like the current forums do to display the module data. So from mod.module.php I would call the theme with some html and stuff. Just need some pointers to set it up.

 Signature 

“In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.” - Douglas Adams, The Hitchhiker’s Guide to the Galaxy

Profile
 
 
Posted: 08 July 2005 03:58 AM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Well, now that EE has a dedicated ‘themes’ directory, you could have your modules’ themes put into there to keep it all organized.  Then, as for calling the, I would suggest looking at mod.member.php specifically the _load_element() function.  What it does is includes the file containing the template data.  The file contains the template data in functions that are part of a larger class (you might opt to skip the class and just use functions), so the data/template can be retrieved by simply calling that class’ function after the include: $template = $CLASS->template_function();

As for parsing the contents of the template, you might take a peek at _final_prep() in the mod.member.php file and you can see how we have abstracted the parsing of language variables and paths.  If you want to do something like {include:another_template} that gets a bit more complicated.

Does that help any?  Not exactly sure what you really need, so I am trying to give some pointers to show you how we are doing it.

 Signature 
Profile
 
 
Posted: 08 July 2005 04:15 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  181
Joined  08-21-2003

Thanks Paul. It sounds like it is what I am looking for. Will wrestle with it a bit and get back here if I need any further assistance.

 Signature 

“In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.” - Douglas Adams, The Hitchhiker’s Guide to the Galaxy

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66467 Total Logged-in Users: 26
Total Topics: 84861 Total Anonymous Users: 16
Total Replies: 455331 Total Guests: 164
Total Posts: 540192    
Members ( View Memberlist )