Web Parts in PHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Afaik, wei has got it right ;) And for what i know the admin modules of (eg:) phpbb and phpnuke allow the user to move 'modules' around on the screen...
fastfingertips
Forum Contributor
Posts: 242
Joined: Sun Dec 28, 2003 1:40 am
Contact:

Post by fastfingertips »

Simple said i'm imaging this:

The admin is able to create a page of the application by selecting the modules and their position (like a lego game), this can be done for every page.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

There are many, many PHP content management systems that can do just that. Drupal and Joomla are the most popular, but there are hundreds of them.
(#10850)
Everett
Forum Newbie
Posts: 3
Joined: Fri Apr 06, 2007 7:17 pm

Post by Everett »

WebParts or WebPart is a component that is loosely binded to other components (WebPart). A page can contain several WebParts, you can drag and place it to some WebPartZone or in lay mans term, a PlaceHolder in your page. You can have a catalog zone where it is the source of all the components that you want to place on your page. There are so many components involved in this but everything is controlled by the WebPartsManager that allows you to identify how those webparts/components are binded.

This is a little tricky if you are going to implement this in PHP because you need to have an in depth knowledge in AJAX for you to wire up the entire structure of webparts.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I am not sure why you would need Ajax to do this. And, I am guessing that all these Web* terms are Microsoft's.

Doing something like this is pretty trivial using templates in PHP. I always use a main layout template and render the various sub-Views into that template. It is pretty standard. I PHP there usually are not drag-and-drop tools for what can be done by editing a template file.
(#10850)
Everett
Forum Newbie
Posts: 3
Joined: Fri Apr 06, 2007 7:17 pm

Post by Everett »

It is simple, you need AJAX to tell the application that you placed a WebPart to a certain location and that means that when you visit the site again, the WebParts are in the location where you placed them. Another with this is, there must be some way that the application (server/backend) knows your profile to perform or to act to what customization you did to your site. Make sense???
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Not really. It would be a cookie, session data or user account data that would retain information like positions. It is my understanding that Ajax is a method to make requests and receive responses from a server using xmlhttprequest() rather than standard page requests.
(#10850)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Are you talking about sites like http://www.netvibes.com/ and http://www.protopage.com/ by any chance%AC
fastfingertips
Forum Contributor
Posts: 242
Joined: Sun Dec 28, 2003 1:40 am
Contact:

Post by fastfingertips »

Yes, any idea for that?

Anyway continuing on the same line, a web part has two user interfaces, one is for administration and one is for a user that is visiting the website. In the backend administration of each part should be made through web-part manager, in this case i will have only one backend controller but i will
have two views for a web-part. Can you recommend me a folder structure?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Plugins?

You'll need to create your own 'framework' for those. Or use an existing 3rd party. "PHP Plugin framework" in google would get you started.
fastfingertips
Forum Contributor
Posts: 242
Joined: Sun Dec 28, 2003 1:40 am
Contact:

Post by fastfingertips »

How the data should be keep?

At this moment i am thinking to have a table where i will keep a list with the web parts, another one where i want to keep web parts datasets catalogue (each web part in the application may have one or more datasets) but how should i save the data from dataset? Should i keep in one table all data or to create separate tables for each webpart :)

Sorry for my question but is a tricky thing and i want to make it done properly.

PS Jenk you are out of the problem, please read all topic :twisted:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I would keep the information needed to build the layout in a single table or in a master template that you generate. Is you layout completely free-form, or will you limit "parts" to certain areas (e.g., header, footer, main content column, sidebar, etc.)?

As for each part's data, it really depends on how different the data is. You could also save the data in INI/XML/YAML files that you generate. Or going even further you could generate the code for the parts from scaffolding.
(#10850)
Everett
Forum Newbie
Posts: 3
Joined: Fri Apr 06, 2007 7:17 pm

Post by Everett »

The thing with webparts is it's a two way thing, it involves personalization (meaning a certain user is identifiable and unique) and at the same time, the webpart configuration, as to what and where it is placed in the screen. This depends on your implementation but I would suggest that you must have atleast two tables. Person is the master and the WebPart is the collection of webparts for that particular user.
Post Reply