Topic: I need some help with a plugin for custom input fields in the backend

Hello everyone...

I'm not too sure if this is too much to ask or not but, I have a question that some of you might just be able to help me with.

I need to be able to define a set of custom input fields in the admin panel of Monstra for page creation. I know that there is a blog plugin that I will be using but I'd like to copy this plugin and create multiple new instances of custom input fields for the creation of a different kind of listing that will act just like the blogging plugin features would allow. I hope that makes sense.

I'll try to elaborate a little more here; I'd need a 'new' section aside a blog that will allow users to create listings much like the blog but with custom input fields, so more than just a title, author and blog content. I have no idea about how I might create the custom fields in a plugin to be used with Monstra, but from what I've been reading on these forums I will need to make a custom plugin, I just can't find enough information as to how I would go about this.

If someone can help give me a basic example or point me towards information that will help me with this, I'd greatly appreciate it, this is mostly for a side project of mine but I really do think that I could make use of Monstra if I could do this, I find it rather intriguing and I'd like to use it for something.


Kind Regards,
Patrick.

Re: I need some help with a plugin for custom input fields in the backend

I'm working on trial and error playing about with the code to try and get something working... If I manage to sort it out I will surely post here, but I've also emailed a more experienced user for some info and advice, so if he manages to help me then I will surely post the findings here and give credit where it's due!

Re: I need some help with a plugin for custom input fields in the backend

I think that I've managed to figure it out now, I'm going to spend some more time working on it and cleaning things up but I have basic functionality so once I'm done I'll share some basic code and likely a write up on how I did it for anyone who may come across this and need the same thing.

Re: I need some help with a plugin for custom input fields in the backend

I hope this is going well. When I tried to build my shop plugin, I started by copying the guestbook plugin because it creates its own 'database' -- look at plugins/guestbook/install/guestbook.install.php

Unfortunately, the 'sandbox' plugin wasn't much help to me. Because there isn't any actual functionality - nothing happens - I couldn't follow the logic.  I had better luck with copying the guestbook plugin.  The guestbook plugin, however, doesn't have a 'backend'. Users (visitors) add comments to the database from the 'frontend'. I had to piece together the backend logic, probably poorly.

In any case, you might take a look at the source of my shop plugin http://shop.monstrahost.com and be able to learn something there.  If you aren't worried about image upload (I haven't gotten that far yet), it might be helpful in seeing how the shop admin pages are built.

Cheers!

Re: I need some help with a plugin for custom input fields in the backend

monstrahost wrote:

I hope this is going well. When I tried to build my shop plugin, I started by copying the guestbook plugin because it creates its own 'database' -- look at plugins/guestbook/install/guestbook.install.php

Unfortunately, the 'sandbox' plugin wasn't much help to me. Because there isn't any actual functionality - nothing happens - I couldn't follow the logic.  I had better luck with copying the guestbook plugin.  The guestbook plugin, however, doesn't have a 'backend'. Users (visitors) add comments to the database from the 'frontend'. I had to piece together the backend logic, probably poorly.

In any case, you might take a look at the source of my shop plugin http://shop.monstrahost.com and be able to learn something there.  If you aren't worried about image upload (I haven't gotten that far yet), it might be helpful in seeing how the shop admin pages are built.

Cheers!

Hey, thanks for that. I did manage to solve what I needed by copying some of the stuff from within the "box" directory of plugins and changing some stuff as required. There are a few things I've still not finished that I need to do.

I've looked over your plugin and it has helped me understand a couple of things a little better. It is a simplified example that shows just what I was first asking how to do, thanks for sharing!


Regards,
Patrick.