- Moderated by:
- Support
-
- rank:
-
Freshman
- registered:
- September 2004
- Status:
- offline
- last visit:
- 30.01.05
- Posts:
- 9
Forgive me if these seem like some basic questions, but I've started work on a small module for PostNuke .750 and find my self spinning my wheels to be compliant. I have a few questions that answers would really help:
1. Why pnRender? Is there a reference to use it or tutorials? If so, can you post it (and while it has merit - the Mark West article is not that much help for a newbie). Can I still use plain Smarty? If I use Smarty do I have to declare the Smarty class or is it already available?
2. Why does Smarty use .tpl templates with logic in {} while pnRender use .htm files with logic in HTML comment format
3. Is pnRender and AutoTheme compatible? Even though everything references Xanthia, the Example module works fine with AutoTheme. My theme is in AutoTheme, does this mean pnRender is a bad choice? What does it really mean?
4. Can I use other output tools - like Pear Quickform or Pear table as an example (I know similar functions are probably in Smarty or pnRender), but I'm very productive with those classes?
My biggest issue is that I don't really know Smarty or pnRender. i can find tutorials about Smarty but not pnRender. But the turtorials about Smarty seem way different than the Example module. I have the Example module to hack away with, but I would prefer a reference about pnRender that explains how it works with Smarty.
thanks in advance for your help! -
- rank:
-
Professional
- registered:
- December 2002
- Status:
- offline
- last visit:
- 24.08.08
- Posts:
- 1588
I have wondered these things as well, the trouble is with things like this it requires the devs to actually do the docs cause no one else really knows jack about how they work. And the thing with devs is the fact that they busy forging ahead making more cool things and do not really have the time to document everything they write. In my opinion this is how it should be - I would rather the software and no docs than the docs with no software LOL - but hey, maybe someone will take pity on us and explain a few basics :)
It's kinda like being the "Greatest American Hero" LOL (Remember that show?)
-Lobos
--
-Lobos
Professional PHP Framework Services: Concept, Development and Deployment -
- rank:
-
Legend
- registered:
- December 1969
- Status:
- offline
- last visit:
- 04.12.08
- Posts:
- 6540
Why not pnRender?emichaud
1. Why pnRender?
Quote
Is there a reference to use it or tutorials?
No real tutorial at the moment, however, there should be a link to the most current reference on the Docs site.
Quote
Can I still use plain Smarty? If I use Smarty do I have to declare the Smarty class or is it already available?
pnRender *IS* Smarty, use it.
Quote
2. Why does Smarty use .tpl templates with logic in {} while pnRender use .htm files with logic in HTML comment format
Partially because WYSIWYG editors handle .htm & comments better and mroe gracefully than it does the default Smarty config, however, Smarty is customizable, i've seen other Smarty implementations where the same changes are made.
Quote
3. Is pnRender and AutoTheme compatible? Even though everything references Xanthia, the Example module works fine with AutoTheme. My theme is in AutoTheme, does this mean pnRender is a bad choice? What does it really mean?
This has been addressed many many many many many times before. pnRender is MODULE templating, AutoTheme & Xanthia are THEME templating. pnRender works fine with AT, Xanthia and AT can co-exist fine as well.
Quote
4. Can I use other output tools - like Pear Quickform or Pear table as an example (I know similar functions are probably in Smarty or pnRender), but I'm very productive with those classes?
If you want to, sure, but if you plan on packaging your creation for others, better make sure what you use is included in the package.
Quote
My biggest issue is that I don't really know Smarty or pnRender. i can find tutorials about Smarty but not pnRender.
The biggest difference is that pnRender uses .htm & comments, where as Smarty's default uses .tpl & {} where you see {} in a Smarty tutoria, replace it with the pnRender style. -
- rank:
-
Softmore
- registered:
- December 1969
- Status:
- offline
- last visit:
- 03.12.06
- Posts:
- 59
Mark West created a guide that may be help you get a better handle on pnRender. The guide is for converting pnHTML to pnRender. I am not sure of the URL off hand, but I think I came accross it on google with a query for pnRender Tutorial.
--
Thank you PostNuke for making it so easy!!! -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
1) Why not? As Michael says pnRender is Smarty. pnRender is a subclass of Smarty. The subclass makes a number of additons to base Smarty class specific to the PostNuke framework e.g. setting template & plugin paths to the current module.
2) Smarty supports custom delimiters (e.g. http://smarty.php.ne….left.delimiter.php. Everything you read in the Smarty documentation is applicable just change the delimiters for the samples to work.
3) pnRender is Smarty for blocks and modules, Xanthia is Smarty for themes. The two are complementary but there's no requirement for use to use both. All modules do is return output to the core for display - the method of generating that output is irrelevant.
4) No reason you can't but that's your choice as a developer. Smarty has a number of supplied plugins, pnrender provides more and you can write your own. You could write Smarty plugins to access the pear functionality if you wanted or you could use another template engine to produce your modules output. I wouldn't recommed the latter if your planning on releasing it since you'll be making things harder for users.
-Mark -
- rank:
-
Freshman
- registered:
- September 2004
- Status:
- offline
- last visit:
- 30.01.05
- Posts:
- 9
Hey Everyone - thanks for all the comments. I've been digging in and I think "I GET IT" now. I'm working on my first module, and I'll have to admit - there is a learning curve, but once you get the hang of it, there are some nice benifits of the PostNuke API and framework.
Hopefully I might even be able to pass on some of what I have learned.
thanks !
