ds111 Posted December 7, 2008 Share Posted December 7, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/ Share on other sites More sharing options...
.josh Posted December 7, 2008 Share Posted December 7, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708784 Share on other sites More sharing options...
ds111 Posted December 7, 2008 Author Share Posted December 7, 2008 making the interface itself is not very hard. What I am concerned about is how it should be saved to the database, and how i should retrieve it, and in what way should I present it? Im all good with the dragging and dropping Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708808 Share on other sites More sharing options...
.josh Posted December 7, 2008 Share Posted December 7, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708833 Share on other sites More sharing options...
ds111 Posted December 7, 2008 Author Share Posted December 7, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708836 Share on other sites More sharing options...
.josh Posted December 7, 2008 Share Posted December 7, 2008 Okay well if it's admin only, check out my tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-708843 Share on other sites More sharing options...
ds111 Posted December 8, 2008 Author Share Posted December 8, 2008 ok, thank you. when i have more time i will look over it more Quote Link to comment https://forums.phpfreaks.com/topic/135970-drag-n-drop-modules/#findComment-709084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.