Jump to content

Recommended Posts

Hey,

 

  I have an idea that I have seen implemented many times, yet is quite a bit hard to explain. Anyways, here goes..

 

  In my CMS, I want to have a section in the ACP where you can drag 'n' drop a block in the left, middle, or right column below or after another block and it save it to the database. Then, it should save it to the database and it should affect the index.php, which is the only one that is to be affected by the rearrangements.

 

Basically like iGoogle, but a Layout Manager.

 

See iGoogle here: igoogle.com

Link to comment
https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/
Share on other sites

The dragging and dropping would be done client-side with javascript.  There are several frameworks out there that make it easier to implement (like jquery).  Updating the order can be done in "real time" using ajax (again, you can use a framework to make it easier, like jquery). 

 

Do a search for custom sort order/custom list order/custom drag and drop list order.  I wrote a tutorial that shows the basic principle, but it's strictly php, no drag and dropping, etc.. so I'm not really gonna point you at it.

Link to comment
https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708784
Share on other sites

Okay well as far as the database is concerned, you can do something as simple as storing a few numbers associated with each available module position.  Are you wanting this custom sorting to be something only an admin can do, or is it something you want each user to be able to do as their own custom layout?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708833
Share on other sites

only admin

 

I was thinking about doing this:

 

Have all the blocks represent HTML/PHP Code with a title right. Then, have it divided into module "bits" where one of the "bits" is the "Sidebar", which includes the Login Form, the Archive Links, etc, all that can be changed in that, then once they click save, it saves that bit. Then it goes back to the layout where they can drag it into a different "group". Basically, in the end i have 3 groups: Left Middle Right and i combine the for all the bits of "right" and put it into db, then do same for middle and left.

 

does that make sense? would that be a good approach?

Link to comment
https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708836
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.