Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty with an Object Orientated Website
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Smarty Forum Index -> Frameworks
View previous topic :: View next topic  
Author Message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Thu Jul 22, 2004 6:39 pm    Post subject: Reply with quote

Hi,
I designed my default page template(s) to always load a $ContentFile which is any name of a valid template file. This can be configured by the calling script or in other cases gets "calculated" from the REQUEST_URI.

You can make the "article template name" a property of the "page-default template" (object) so the designer can set this property. If it's set, it'll cause the page to load whatever template is given there, otherwise uses "article.tpl" as its default. you may restrict the list of possible templates that can be used as "articles" in any fashion you find appropriate: hardcoded or dynamic from some list of tpl-names.

Hope this helps,
CirTap
Back to top
View user's profile Send private message Visit poster's website
Archytas
Smarty Rookie


Joined: 07 Jul 2004
Posts: 15
Location: The Netherlands

PostPosted: Thu Jul 22, 2004 7:56 pm    Post subject: Reply with quote

Well, I've got the file serve_object.php. serve_object.php?id=$id will echo the object that belongs to that object_id. If my designer wants to include a poll for example that is in poll.tpl than she can include the right object from the database called serve_object.php?id=16 or something, but since the object will probably be added to the database after the designs were made she can't know what this id property should be.

Quote:
Hi,
I designed my default page template(s) to always load a $ContentFile which is any name of a valid template file. This can be configured by the calling script or in other cases gets "calculated" from the REQUEST_URI.


Well, every object has got the template property, the only problem is that the designer will know which template to use, but not which object number that would be after filling the database with the right objects. Since I like the idea to split up the design work from everything else, I don't like to edit templates after my designer made them. Isn't it possible to include just the poll.tpl in her page and that the script will determine (through relations) which poll this should be?
Back to top
View user's profile Send private message Visit poster's website
pkej
Smarty n00b


Joined: 19 Oct 2003
Posts: 4

PostPosted: Tue Sep 07, 2004 9:26 pm    Post subject: Reply with quote

Archytas wrote:
Well, I've got the file serve_object.php. serve_object.php?id=$id will echo the object that belongs to that object_id. If my designer wants to include a poll for example that is in poll.tpl than she can include the right object from the database called serve_object.php?id=16 or something, but since the object will probably be added to the database after the designs were made she can't know what this id property should be.

Quote:
Hi,
I designed my default page template(s) to always load a $ContentFile which is any name of a valid template file. This can be configured by the calling script or in other cases gets "calculated" from the REQUEST_URI.


Well, every object has got the template property, the only problem is that the designer will know which template to use, but not which object number that would be after filling the database with the right objects. Since I like the idea to split up the design work from everything else, I don't like to edit templates after my designer made them. Isn't it possible to include just the poll.tpl in her page and that the script will determine (through relations) which poll this should be?


I think you should consider making templates for each object first (you've probably done that already). Next step is to make one (or all) objects use your own text parser (made in PHP) which will insert content from other objects.

Then make a plug-in for smarty which uses the parsed text to fetch the right content and templates and inserts it into the flow.

Now you need to make something in the admin interface where the user can select any objects and embed them into their article. A popup window for browsing the hierarchy/contents of the site and insert the correct code (which you've created a parser for in step one) into the edited content.

So, whith these three "simple" steps you've made the designer's job very modular, she will only have to make one template for each type of object, and the system will decide which templates to use for which objects when embedding them.

The next question you'll get from your designer is how you can make a specific template for one object only... Or perhaps for a design on one part of the site which differs from other parts.
Back to top
View user's profile Send private message
pkej
Smarty n00b


Joined: 19 Oct 2003
Posts: 4

PostPosted: Tue Sep 07, 2004 9:34 pm    Post subject: regarding multihoming Reply with quote

I see you have your system supporting several homes in the hierarchy. I've been a fan of this approach myself, but I've come to believe that it might actually not be such a good idea, or rather, that it is a poor solution to a difficult taxonomic problem.

For some systems multihoming might be appropriate (do the Alps belong to France, Italy or Switzerland? ), but often several hierarchies/keywords might be the proper solution to the problem.

As for knowing which path is the right for an object (when creating a breadcrumb trail), in eZ publish we used something called "defining path". Of course, for the geographical problem above it wouldn't work very well, would it?

But then one has to ask, is a hierarchy the right way to organise spatial data...

I myself have started to realise that I've been infatuated with hierarchies to the exclusion of other methods of organizing data. It seems that it is a common mistake in the CMS/blogging world.

"Trees are shiny things. We like shiny things. Lets use shiny things everywhere." - me, now
Back to top
View user's profile Send private message
realny
Smarty n00b


Joined: 03 Nov 2004
Posts: 1

PostPosted: Wed Nov 03, 2004 4:29 pm    Post subject: Some test data to feed db schema with? Reply with quote

I'd very much like to see some actual data to insert into Db schema presented by Mocean to observe how system works... Could someone possibly post here a few records?

Also, Mocean mentioned about demo CMS but provided link seams to be 404-dead...

Best regards,
Piotr
Back to top
View user's profile Send private message
mocean
Smarty Rookie


Joined: 21 May 2003
Posts: 30
Location: The Netherlands

PostPosted: Sat Nov 06, 2004 11:59 am    Post subject: Reply with quote

I have a new demo, mostly in Dutch (sorry).

New Demo website: http://demo.mocean.nl/

Database dump: http://demo.mocean.nl/moceandemo.txt


I hope to have the CMS up soon (in fact it is), but there are some problems securing it. Because I want to use only one sourcetree for the backen, I have to make sure there are some limitations like PHP tags, some plugins, fileupload etc.
_________________
Visit My Smarty Enabled Website (Dutch Only) at www.habiforum.nl
and read how it works.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
smartymoon
Smarty Rookie


Joined: 29 Apr 2003
Posts: 15

PostPosted: Wed Dec 01, 2004 12:37 am    Post subject: prado: php5 class framework Reply with quote

Anyone has a chance to study prado? See here. http://www.zend.com/php5/contest/contest.php or http://www.zend.com/php5/contest/contest.php?id=36&single=1
Prado is a framework written in php5 class for the coding contest.
it is coded in an object oriented programming.
it doesn't use smarty but its own template system. maybe it needs object oriented template system?
the author says he got the idea from asp.net but i am not familiar with asp.net.
I think if you know foxpro db, you can understand the frame easily.
i don't have enough time to see the code but i hope we can combine both the code frame and db frame together.
Back to top
View user's profile Send private message
Onedamobamomi
Smarty n00b


Joined: 08 Jul 2011
Posts: 4
Location: Greenland

PostPosted: Sun Oct 23, 2011 1:25 am    Post subject: Smarty with an Object Orientated Website Reply with quote

Im doing an animation, and Id need an object to just rotate with a constant speed. I thought of using a cript for this. But being a total noob with 3dc scripting I just cant get it. Ive tried a lot, but in vain.

Could someone be so kind and post an animation script that would just rotate an object or group, if easier around its y -axis. The speed also doesnt have to be given in any real format like revolutions/second, just that I can set in the code to something that looks good.

Timo
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Frameworks All times are GMT
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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