Root :: Developments :: Tutorials and programming :: Xanthia / Smarty and Templates...
Moderated by:
| |
Xanthia / Smarty and Templates... | |
|---|---|---|
| omorel | Posted: 20.04.2004, 10:33 | |
Noob
registered: Apr 06, 2004
Posts: 8
Status: offline last visit: 21.04.04 |
Hi, I'm developping a new module for pn and I am using the new Xanthia module for pn version 0.726-1. I would like to do this : -> main fonction : -> fonction "a" : -> render a template -> fonction "b" : -> render another template -> render a third template. So how could I append the result of one template to another one ? Oh and I would like to be able to call the templates from inside pn and not from another template... |
|
|
|
|
|
| Chestnut | Posted: 20.04.2004, 14:25 | |
|
Site Admin
registered: Jun 02, 2002
Posts: 1320
Status: offline last visit: 07.02.08 |
The Example mod is your best friend ;) (the pncSimpleStatsX also) I don't fully understand your list with function but I'll go this way... we will be able to correct things. Example of applications : If you want a top menu that will be on all pages, you can do a simple include in your template : file : yourmod_user_menu.htm Now to include that in your templates : yourmod_user_main : Voilą for the menu ! Now if you look at function Example_user_view() in the Example mod... The function fetch all example items : then, (after one or 2 manipulations), input in a template each of these items and all this will be in an array : Now the array var $exampleitems have a template for each item. Next... the array is sended to another template, the view page : In the 'example_user_view.htm', there is a var 'items' that contains a template ('example_user_row_read.htm') for each items. example_user_view.htm : This loop and most explicitly, this line : is our example_user_read.htm template that contains one item of the list. The loop make it so we show all items of the list. See the example mod and the pncSimpleStats (where I wrote LOTS of crappy comments) for other examples like this. Hope this helps a bit ! At least for a start ! Chestnut ! ![]() Site Admin |
|
|
|
|
|
| Chestnut | Posted: 20.04.2004, 14:27 | |
|
Site Admin
registered: Jun 02, 2002
Posts: 1320
Status: offline last visit: 07.02.08 |
Damn... the pncSimpleStats was made using the pnHTML, not the pnRender. the pncSimpleStatsX is made for the pnRender but I didn't wrote the comments in it... I must not forget to change that. Chestnut ! ![]() Site Admin |
|
|
|
|
|
| omorel | Posted: 20.04.2004, 15:37 | |
Noob
registered: Apr 06, 2004
Posts: 8
Status: offline last visit: 21.04.04 |
Ok, i'll show you what I've done... and maybe you'll be able to help me a bit (no, I'm not too lazy to read what you wrote, I have read it). so : it's based on a plugin model. this is a plugin. this is the main fonction. but it only displays pnsCommentarium_reviews_short_display.html ... :( Please... help me... [/code] |
|
|
|
|
|
| Chestnut | Posted: 20.04.2004, 16:08 | |
|
Site Admin
registered: Jun 02, 2002
Posts: 1320
Status: offline last visit: 07.02.08 |
Check the file... I think it would be a better start... Always remember that the GUI (interface, rendering, the display is in the user functions)... userapi are function that returns a value like a sql result, etc... Unless the inevitable I guess. Note also that the pnModAPILoad is done once... I moved it up. Chestnut ! ![]() Site Admin |
|
|
|
|
|
| omorel | Posted: 21.04.2004, 12:08 | |
Noob
registered: Apr 06, 2004
Posts: 8
Status: offline last visit: 21.04.04 |
Ok, there I found my "mistake" or what I misunderstood... I would like to develop a module which plugins could add their one GUI code... how would it be possible ? PS : sorry for the silly questions, new to pn... |
|
|
|
|
|
| Chestnut | Posted: 21.04.2004, 12:45 | |
|
Site Admin
registered: Jun 02, 2002
Posts: 1320
Status: offline last visit: 07.02.08 |
The file I gave you contains what you ask. This part : fetches the items (array) you need... This part : Assign the items to the template of the plugin you want : this : pnsCommentarium_'.$module['module'].'_display_short.htm Is your display for the plugin. Chestnut ! ![]() Site Admin |
|
|
|
|
|
Powered by pnForum Version 2.0.1


