Jump to content

Just For Kicks....


dpiearcy

Recommended Posts

Back before Facebook came out with that stupid timeline feature I decided I wanted to build a Facebook like application in php just to see if I could.

 

It came out more like twitter but at any rate...

 

Now I'm moving on to something like Constant Contact. I love their content management system they use to create the HTML email. Something similar to a "Widget" in Wordpress. You drag a different element (text with image for example) on to the page then edit that container. (looking at the source code they are using tables which makes sense since it's an mass email program and inline CSS works best for those so tables are much easier). So basically these little code snippets are nothing more than a new <tr> etc.

 

I am looking at a few different jquery drag and drop options. Plenty already put together to choose from.

 

But here's where my thinking starts to get muddled.

 

The drag (widget) area will be in a <div> floating left. Everything else will be placed in a different <div>.

 

My question is, what would you think would be the best way for me to get the contents of that second <div> without making that entire <div> a variable and storing its contents in medium txt on mysql?

 

Since I am using AJAX with those and the database will be updating on the fly.... I'm thinking each widget area should have variables for title, color etc. with default of these set when the include the widget.

 

When they begin a new email template I can assign an ID to that row then can update the values of that row where id = $pid or whatever.

 

But determining WHAT widget is placed on the page. I don't want to echo what's not there (default values previously discussed already stored in MySql). Obviously an "IF and ELSE IF" would work but haven't ever written an IF statement where I'm seeing if it's in a div. Nor would I know how to change an int from 0 to 1 just because I moved it to a different div (again the IF statement).

 

So there's the loop. Now I'm back to thinking that entire <div> should be a variable.

 

Thought I would throw it out here first but will probably be examining how Wordpress does it with their widgets after I'm done typing here. Obviously the header and footer <div>'s will be easy enough. It's the main content I'm having trouble trying to figure out how to organize.

 

Anyone done something like this already?

 

Or there may be a CMS out there I'm not familiar with that is already utilizing this function that's open source but I've been unable to locate one and would much rather write this myself as it's, as I said, just a matter of honing my skills (or lack thereof as is the case) ;-)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.