hello all of you
I would like to know if the attributes on the new object (ElggObject, ElggGroup) created on elgg can only have as attribute name on an input field or other than (title and description), because I have created an ElggGroup object which here is the form
// title
echo elgg_view_field([
'#type' => 'text',
'#label' => elgg_echo('camerproject:title'),
'name' => 'title',
'value' => elgg_extract('title', $vars),
'required' => true,
]);
echo elgg_view_field([
'#type' => 'file',
'#label' => elgg_echo('camerproject:logoproject'),
'#help' => elgg_echo('camerproject:edit:icon:limit', [$upload_limit]),
'name' => 'icon',
'value' => elgg_extract('icon', $vars),
'required' => true,
]);
echo elgg_view_field([
'#type' => 'plaintext',
'#label' => elgg_echo('camerproject:summery'),
'name' => 'summery',
'value' => elgg_extract('summery', $vars),
'required' => true,
]);
echo elgg_view_field([
'#type' => 'dropdown',
'#label' => elgg_echo('camerproject:progress'),
'name' => 'progress',
'options_values' => $progress,
'value' => elgg_extract('progress', $vars),
'required' => true,
]);
and when I try to interpret my different attributes. of which here a function defined for this is:
/**
* {@inheritDoc}
* @see ElggEntity::getURL()
*/
public function getURL() {
$friendly_title = elgg_get_friendly_title($this->getDisplayName());
return elgg_normalize_url("camerproject/profile/{$this->guid}/{$friendly_title}");
}
but the function getDisplayName () does not work the other attributes except on those whose name of the input field is (title and description)
Please help me,
regards,
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
this is my action edit file
this in my class Camerproject :
I take it CamerProject extends ElggGroup?? with a different 'subtype'?
small error in your code
should be eighter $project->name = $title; or $project->name = get_input('title');
I corrected. but it does not always work but I do not know about ??? please help me
@RvR please how it works
1. UnZip/Activate
2. Go to Dashboard -> Administer section -> Groups -> Subtypes
3. Add new subtype for group (e.g. camerproject) -> Submit
4. Choose options. You can set your own page identifier like as 'groups/camerproject'. In this case your 'camerprojects' will located in such URLs site.com/groups/camerproject/profile/{GUID}/{NAME}
(screenshot can say more than words).
Additional, you should translate some language keys.
Also, keep in your mind that you need to enable/disable your own hooks/actions for your project in your own plugin/theme.
Of course, welcome to PRs on the plugin's page.
thanks @RvR
- Previous
- 1
- 2
- Next
You must log in to post replies.