Hello, i like add new object of plugin pages for a group.this is correct??
the group guid are 857
$object = new ElggObject();
$object->subtype = 'page_top';
$object->description = 'lore ipsum';
$object->container_guid = '857';
$object->save();
thanks!!!
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.
$object->title = $title;
$object->owner_guid = elgg_get_logged_in_user_guid();
$object->access_id = ACCESS_PUBLIC;
thanks!!!
I'm sorry but dont work.i understand I had to add what you said:
$object = new ElggObject();
$object->subtype = 'page_top';
$object->description = 'lore ipsum';
$object->container_guid = '857';
$object->title = $title;
$object->owner_guid = elgg_get_logged_in_user_guid();
$object->access_id = ACCESS_PUBLIC;
$object->save();
i think that the problem is in subtype??
thanks!!
I think the statement should be like this:
$object = new ElggObject();
$object->subtype = 'page_top';
$object->description = 'lore ipsum';
$object->group_guid = '857';
$object->access_id = ACCESS_PUBLIC;
$object->save();
Rodolfo Hernandez
Arvixe/Elgg Community Liaison
Also, container guid should be an integer, not a string. Not sure if that makes a difference, but it should be an integer.
i'm sorry but dont work :(
You need to be a bit more descriptive with *what* exactly isn't working. Otherwise we can't be of any more help.
please, sorry matt.
i use this code:
$object = new ElggObject();
$object->subtype = 'page_top';
$object->title = 'title 1';
$object->description = 'lore ipsum';
$object->group_guid = 127;
$object->access_id = ACCESS_PUBLIC;
$object->save();
It really does not explain anything very well as you for information, have one error :
- The main page of pages/all appears blank.
but really I have no more information, look in phpadmin but do not identify the error.
If i see on screen the value of $object gives me the following:
very very
very thanks!!!
[owner_guid] => 0
[container_guid] => 0
You didn't give it a valid owner/container - you're probably getting a white screen because php is trying to render a non-existant owner.
is true!!thanks but i dont know that resolve this.
- Previous
- 1
- 2
- Next
You must log in to post replies.