1
Kainaij
Smarty is freakin the heck out of me!
  • 2004/11/30 7:48

  • Kainaij

  • Quite a regular

  • Posts: 256

  • Since: 2004/10/5


I have been reading up on installing smarty so that I can "get my feet wet with it". Dabble if you will. I have moderate web development skills and I know that I want to do some solid work with the XOOPS CMS. Problem is I look at the smarty download file and try to upload it to my shared host webserver from globalhosting.com. It is at this point where I do not know what the heck I am doing. I can not find no index.php or config.php or even an install.php file in the bunch. I am absolutely willing to learn about it, and in my past experiences "hands on" was my best strategy for learning about new tools. This is frustration me because this tool to me seems to have no interface. Am I just completely missing the boat on the whole smarty party?

Maybe I'm rambling, maybe I'm looking in the wrong direction for a "tight web theme" design tool, maybe I'm in over my head, maybe XOOPS isn't the right CMS for my retarded understanding, maybe I should go to bed and try again tomorrow.

What do I want?
I want a site that looks like Winamp's site. I also like how Draven put together his portal page to his site and how it packs a lot of content into a tight functional flowpiece. I do not need tons of bells and whistles. A forum (newBB), chat (flashchat), and news module would be the main focus of my online community site. A portal page with a constant header that follows the visitor thru the site. This header would include at the most a cached dhtml drop down menu (I purchased xara's menumaker a while back) that would allow the visitor access to all areas of the site with a single click.

Is that too much to ask for? Is smarty the right tool for this job? If not, what alternatives do I have?

Thanks for hearing me out.

My specs:
Globalhosting.com
NewBB RC3
Latest Xoops
MySQL 4.0.21-standard

2
Mithrandir
Re: Smarty is freakin the heck out of me!

You have been reading up on Smarty?
Quote:

I can not find no index.php or config.php or even an install.php file in the bunch

Why are you looking for that, if you have read the Installation manual?

Are you sure, you know what Smarty is?

3
Kainaij
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 9:33

  • Kainaij

  • Quite a regular

  • Posts: 256

  • Since: 2004/10/5


I am not sure what smarty is or what it can do for me, which is the gist of the original message. I will edit the original message and remove the reference to the line you refer to. My point is that I am used to using an interface to create. I do not know where to start using smarty.

Do not take my rants as a personal attack, in fact I appreciate your reply. I just am at a loss at wtf I am supposed to do with this program. In short I fail to see the beauty in which smarty can provide for me.

Am I a wannabe g in a php world? perhaps. I better sleep (yawn).

P.S.
too late to edit original post.

4
Herko
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 11:01

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


SMarty is a template engine, used in conjunction with a script to manage your content. Smarty by itself doesn't provide an interface for your content editing, the script it is implemented into does. XOOPS is one of those scripts.

Herko

5
rowdie
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 11:51

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


If I remember correctly the Smarty download has a demo folder, with example templates and an index.php file. I suggest you look for it, it's a nice example of how to use Smarty.

Smarty isn't a tool, there is no interface... it's a templating engine. This effectively means that you put Smarty elements in a html template (as in the demo templates) and the Smarty engine takes care of exchanging those elements for data from your database. The php code (as in the demo index.php file) is where the template is declared and data is assigned to the Smarty elements.

Xoops has Smarty built into it, take a look at the template files for the news module to see how to work with it.

Good luck with it all

Rowd

6
Mithrandir
Re: Smarty is freakin the heck out of me!

Yes, sorry if I sounded like I retaliated on an attack. I just meant to highlight (rather clumsy) that you have misunderstood what Smarty is.

Instead you should say "What can XOOPS do for me". You(r initial post) seems to ask the question "How can I use this V8 Ford engine to get a luxurious car", where the engine is something that is used by the car as a whole to give you the feeling of luxury - but it is not everything and taking the engine apart to see how the airconditioning works... that's not the way to understand it

(A little stylized example that just shows that a metaphor can be pushed too far )

7
carnuke
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 12:47

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Smarty is a template engine for PHP. More specifically, it facilitates a managable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases are not the same person. For example, let's say you are creating a web page that is displaying a newspaper article. The article headline, tagline, author and body are content elements, they contain no information about how they will be presented. They are passed into Smarty by the application, then the template designer edits the templates and uses a combination of HTML tags and template tags to format the presentation of these elements (HTML tables, background colors, font sizes, style sheets, etc.) One day the programmer needs to change the way the article content is retrieved (a change in application logic.) This change does not affect the template designer, the content will still arrive in the template exactly the same. Likewise, if the template designer wants to completely redesign the templates, this requires no changes to the application logic. Therefore, the programmer can make changes to the application logic without the need to restructure templates, and the template designer can make changes to templates without breaking application logic.

XOOPS uses the Smarty Template Engine and XOOPS scripts have Smarty tags embedded in the code. Smarty tags are identified by the delimiters <{ and }>. If you see variables, conditionals or functions inside those delimiters, they are considered Smarty tags.

Smarty tags speed up site loading because the content of these tags have already been processed and compiled. So instead of creating a script to call out the site url, the username or even the theme folder, a Smarty tag is used.

The great thing about using Smarty tags inside the theme.html is that it allows better control of layout by having a Smarty tag represent a content instead of a php script. Smarty tags can be placed in between HTML tags to enable formatting.

8
Herko
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 13:10

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


ok, this is slightly off topic, but fuelled by the clear explanations for the purpose of the smarty engine, I'd like to pose (for the purpose of the discussion) that SMarty is obsolete with XHTML 1.1.

Why?
The webstandards.org FAQ states this:
Quote:
XHTML 1.1 is made up of three primary parts:

* The XHTML 1.0 Strict DTD (with minor modifications)
* XHTML Modularization
* The Ruby Annotation

If you’d like to author documents in XHTML 1.1, you can do so in a couple of ways. The first is by using the public XHTML 1.1 DTD. By doing this, your work will be extremely structured because there are virtually no presentational attributes in XHTML 1.1. The separation of structure and presentation is complete here, and all of your presentation work will go in a style sheet.


Smarty's use of separating presentation (logic) from apllication (logic), is then obsolete, as XHTML 1.1 has no presentational attributes, but uses stylesheets for that.
In fact, this is already possible (take the CSS Zengarden website for example).

Now, Smarty simplifies the process of defining the layout of dynamic content, but isn't this really just overhead? PHP creates $string content, that can be called on by using simple statements in your HTML. Combine that with XHTML 1.1 and CSS, and you have a native template system (XHTML/CSS) and dynamic content generator (php).

Herko

9
jmass
Re: Smarty is freakin the heck out of me!
  • 2004/11/30 13:34

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Yes you can use XHTML/CSS as a native templating engine, and I can use the handle of a screwdriver to pound in a nail too. But it does not work as well as a hammer.

I see two real drawbacks. First, if you start plugging in PHP to templates and it will get abused. Not might, WILL. Second is the seperation of not just look but layout. I know this could be done with two css sheets, one for look and one for layout, but this would be very clumsy. Again I think this would be not done or abused.

The templating engine allows for an enforcement of the seperation. Something that is very needed in a community project.

10
Mithrandir
Re: Smarty is freakin the heck out of me!

I am generally in favour of Smarty on the basis that it is very simple and easy to use. But Smarty as it is now can be abused just as much as normal PHP can - I see it in many themes and templates, just like I see quite a bit of presentation in the module PHP files.

One thing that makes me want to continue using Smarty for a while yet, is the caching feature. Until we have a PHP-only solution with caching working better than in Smarty, I really don't see how it can replace Smarty.

Login

Who's Online

328 user(s) are online (231 user(s) are browsing Support Forums)


Members: 0


Guests: 328


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits