projects / org / se7enxweb / powercontent
Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
powercontent | 7x | stable |
Version | Compatible with |
---|---|
N/A | N/A |
Copyright (C) 2006-2007 SCK-CEN
Written by Kristof Coomans ( kristof[dot]coomans[at]telenet[dot]be )
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The Power content module allows one-click publishing or pre-filling of attributes, similar to the Object Creator extension (http://ez.no/community/contribs/hacks/object_creator). However, it uses content/edit for the final processing.
This module has one big advantage: it can deal with any type of attribute, even new custom ones.
The main idea is to add new attributes that are going to contain the values you want instead of the default ones on ez publish. This module associate these new fields with standard fields that exist when editing with the default edit template. Therefore, you have to understand how ez names these fields so you can add the values you want.
A typical naming scheme for the input fields of an attribute is:
ContentObjectAttribute[some attribute specific name][contentobjectattribute id]
For instance the name for the fields of an articles are (do a view source of the page when you're editing an article):
You will have to to change these names to:
powercontent_[contentclassattribute identifier]ContentObjectAttribute[some attribute specific name]_pcattributeid
For the article, it would be:
-title: powercontent_title_ContentObjectAttribute_ezstring_data_text_pcattributeid
-intro: powercontent_intro_ContentObjectAttribute_data_text_pcattributeid
When the Power Content module processes this kind of post variables, it will take their content and put them into the proper fields as if the user would have inputed it (it will inject fake post variables where the string "pcattributeid" will be replaced by the expected contentobjectattribute id).
On the top of the parameters you want to "prefill", you have to provide a few additionnal ones:
1) Example code for the "article" content class. This will prefill the title and intro of the article:
<form method="post" action={"powercontent/action/"|ezurl}>
2) Example code for the "File" content class:
<form method="post" action={"powercontent/action"|ezurl} enctype="multipart/form-data">
Publish immediately: