hi all,
I have set up a form to allow for adding & editing news items using the submit article action.
my setup:
preview tab:
text box - title
text area - introtext
text area - fulltext
hidden field - id
submit button
events tab:
on load:
Custom Code - page head (pathway adjustment, componentheading, h3 header)
db record loader - DB Field (id), Table (jos_content), Request Param (token)
show html
on submit:
Submit Article - Article Title Field (title), Full Text Field (fulltext), Intro Text Field (introtext), Author Alias Field (created_by_alias), Published:yes, category: news, section: news
Custom Code - message
prob 1)
I am running into a prob when trying to edit an existing item - a new content item is being created instead.
when looking at the action I noticed that neither field modified nor modified_by are being mentioned
I suppose something like
needs to be added somewhere.
prob 2)
also my users should be able to include images into articles as is possible when using the default means for adding content items. the textarea for introtext should be a regular textarea, that for fulltext an editor area. I think that would require an additional config param in the text area element (no / yes options) plus something like
could you please advice ?
J!1.5.23, CF4 RC 2.0
I have set up a form to allow for adding & editing news items using the submit article action.
my setup:
preview tab:
text box - title
text area - introtext
text area - fulltext
hidden field - id
submit button
events tab:
on load:
Custom Code - page head (pathway adjustment, componentheading, h3 header)
db record loader - DB Field (id), Table (jos_content), Request Param (token)
show html
on submit:
Submit Article - Article Title Field (title), Full Text Field (fulltext), Intro Text Field (introtext), Author Alias Field (created_by_alias), Published:yes, category: news, section: news
Custom Code - message
prob 1)
I am running into a prob when trying to edit an existing item - a new content item is being created instead.
when looking at the action I noticed that neither field modified nor modified_by are being mentioned
I suppose something like
$isNew = ($form->data['id'] < 1);
if ($isNew) {
$form->data['created'] = date("Y-m-d H:i:s");
$form->data['created_by'] = $user->id;
} else {
$form->data['modified'] = date("Y-m-d H:i:s");
$form->data['modified_by'] = $user->id;
}
needs to be added somewhere.
prob 2)
also my users should be able to include images into articles as is possible when using the default means for adding content items. the textarea for introtext should be a regular textarea, that for fulltext an editor area. I think that would require an additional config param in the text area element (no / yes options) plus something like
if ($element_params['enable_editor'] = 1) {
$editor =& JFactory::getEditor();
echo $editor->display($field, $value, $width, $height, $cols, $rows);
}
could you please advice ?
J!1.5.23, CF4 RC 2.0