New page item!

General project discussion. NOT for help questions.
Post Reply
angels

New page item!

Post by angels »

Okee now a little more difficult question. I'm trying to add a extra option for the add content page.

This is what i allready found out,

Added a row (named "extra") in table cms_content in phpmyadmin

found query's in class.content.inc.php and added the "extra" row.

But now i cant find the form which the cms uses to add the content to the database.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New page item!

Post by Ted »

Content types are stored in lib/contenttypes.  The type itself defines the add/edit form.

Instead of making an extra field, do this:

1. Copy the Content type to something else.  MyContent or similar.
2. Add a new property for that extra option. (look in SetProperties).  When you add the new property, it's automatically stored into the database in cms_content_props.
3. FillParams doesn't need any changes.  New properties will automatically work.
4. The Show function controls what is rendered when the content type is viewed.  You might need to modify this to show this extra parameter, if it's for display.
5. Most importantly.  Add the property to the array that EditAsArray pushes out.  These are the fields that show up in the add/edit page.

You should hopefully not have to touch the database to do any of this.  Let me know how it works, since this is the first time I've actually described to anyone how the content types worked.  (no one has asked.  :)  )
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New page item!

Post by Ted »

Yeah, I saw.  I figured I'd cut it off before he got too much futher.

Thanks.  I really love the content types stuff.  It's still a little too much work to add types, though.  I want to streamline it more in 2.0.
angels

Re: New page item!

Post by angels »

ill work on it tommorow.. thanks :P Does it also allow to upload a image in the add_content page. Wich i can call in the template with a user tag? So eith page will get differend images.. :P

I know i ask a lott here but when all this works out with the CMS system i will use it standard and will be willing to pay for it!
Last edited by angels on Fri Jul 29, 2005 2:59 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New page item!

Post by Ted »

It's not in there by default, but it shouldn't be too hard to add.  The only real issue will be setting the form tags on the add/edit content pages to have the enctype="multipart/form-data" in them.  The rest is easily handled inside the content type.

I can help out if you need it...
angels

Re: New page item!

Post by angels »

Hmm I got the extra string! but how can i put something in there :S I workend on this allready 2 days :S:S Dont get it :(
Last edited by angels on Sat Jul 30, 2005 12:26 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New page item!

Post by Ted »

Maybe you should jump on IRC.  This could turn out to be a long thread.  :)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New page item!

Post by Ted »

Ok.  I have a working version of this on my box.  Next time you get back on IRC, I'll send it over.
Post Reply

Return to “General Discussion”