How to edit an existing posting?

Author Message

Nebojsa Eric

Thursday 11 May 2006 8:53:41 am

1. How to edit an existing posting? (let`s say that I have posted something and I should edit that).
2. How to store in the database some field representing condition that will be used in filter fetch operations later? That field should be generated by system, not by user. (let`s say that I have one class that I want to use in different templates and I need some field to make a difference between data)

Thanks.

Marc Boon

Friday 12 May 2006 2:05:06 am

I can answer question 2:
In the admin interface, select tab 'Setup' and then click on 'Classes' in the left menu.
The class you want to modify is probably in the Class Group named 'Content'. So click on that, and find your class. Edit the class by clicking on the edit icon on the far right of the class list.
Now you can add a new attribute to the class. Choose a suitable datatype and give it a name and identifier. After saving the class definition, go back to the Content Structure page, and edit your existing objects of the class, or create new ones, and specify the value of the newly created attribute.
In your template code, you can use attribute filtering to fetch the objects that you need, based on the value of your new attribute.

See also:
http://ez.no/doc/ez_publish/technical_manual/3_7/concepts_and_basics/content_management/the_content_class
http://ez.no/doc/ez_publish/technical_manual/3_7/concepts_and_basics/content_management/class_attributes
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/modules/content/fetch_functions/list (look under 'attribute filtering')

Nebojsa Eric

Monday 15 May 2006 2:32:39 am

Thank you Marc for your reply.

Seems that we don`t understand. :)

My situation is: User clicks on button. Override of content/edit.tpl template appear with all fields from my custom class avaiting to be filled-in and submited. At this point I should generate code logic to hide one specific field (user can`t see that field, user can`t change that field), but into that field, submit operation should insert value. It`s a simple request.

First question is about editing an existing posting and delete existing posting. How to do that in eZ Publish?

Situations I`m facing are sooooo common for site building. Maybe eZ works on some specific way. I know how to solve those simple requests in many other languages, but this "eZ black box" is driving me crazy.

Raymond Williams

Tuesday 16 May 2006 4:55:21 pm

Nebojsa,

If I'm understanding your question...

As an admin, you should have access to edit all content items created on the site through the admin console. Using the admin console, navigate to the location the specific post is in, click on the icon to the left of the post name, and choose Edit from the menu. You can then edit the item and publish those changes. A note, if you decide not to publish the changes, use the Discard Draft button. Do not just close the window or use the back button in your browser, as it will leave unfinished drafts in your history.

In the second situation... Are you talking about content editors filling out forms in the admin section for creating new content? If so, I am afraid I don't have an answer for you... It might be easier if you gave us an example or explanation of what you're trying to do, instead of how you're trying to get there?

FWIW

[EDIT - As I reread your post, I realize what you're saying about situation 2. You have an overriden edit template, not the default, and want to prepopulate certain data_map values instead of allowing the user to enter them. I haven't done that, but now you have me curious. If I figure anything out, I'll post.]

Nebojsa Eric

Wednesday 17 May 2006 5:19:23 am

Hi there, Raymond.

OK. I`ll try to explain. I`m building one hell of the site. It`s a combination of online shop selling musical instruments and accessories + a meeting point for musicians on other areas. These other areas are “gig postings”, “bands wanted”, “musician wanted”, "band advertise pages" and “demo postings for bands” (available for download). Gig postings are divided in two sections: gigs for individual bands and gigs for venues. Gigs for individual bands are free, gigs for venues are not. Every user, signed on the site, should be able to post, edit and delete own postings no matter what those postings are (gigs, demos...) and all posts and edits should be approved before publishing. Complete site should be easy extendable followed by some sort of CMS. That`s why we decided to enter the world of eZ Publish.

After 20 days of searching, reading and clearing cache directly on the server, I`ve managed to work pretty much of it so far. Everything is going fine until I`ve started developing gig postings section.

Like I said, gig postings are divided in two sections. For this purpose, I`ve created one class named GIG containing different attributes (band name, admission, performance date and so on). That one class is used for both individual gigs and venue gigs instances.
I`ve created two folders under main Gig Postings folder -> named Individual and Venues. Venue class is a container, so every instance of the venue class can contain instances of the Gig class (gig postings for venues).

So, my questions are:
1. How to allow registered users to edit and delete their own postings like here on forum where you can edit your posts?
2. How to fetch all gigs (individual and for venues) together into one array from two different folders? I need this because gigs for registered venues have privilege to be first in the list ordered descending by performance date. My idea is to add integer field into gig class with possible values 1 and 2, for example, representing source of the gig (individual or venue).
3. How to store instance of the class into two or more folders? Any example of the overrided edit_placement.tpl would be nice.

Any ideas how to solve this?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.