Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking
  • Elgg Technical Support

    Elgg Technical Support

    Get support from other Elgg users
  • Professional Services

    Professional Services

    Get / offer professional help on Elgg; like customization, design, development, setup, hosting... Illegal trades are not allowed.

Activity

  • rsai added a new discussion topic Need help in hosting/setting up Elgg in the group Professional Services
    We are looking for some help in setting up Elgg (NI/NH/NS). PLease let us know if someone is available. We would like to discuss more on this.
  • rsai replied on the discussion topic How to add custom fields in Elgg entities
    sorry.. typo on the first step.   elgg_register_library('elgg:my_blog', elgg_get_plugins_path() . 'my_blog/lib/my_blog.php'); view reply
  • rsai replied on the discussion topic How to add custom fields in Elgg entities
    Please correct me if I am doing anything wrong here.   1. Register the Entity in start.php <?php elgg_register_event_handler('init', 'system', 'my_blog_init'); /** * Init blog plugin. */function my_blog_init()... view reply
  • rsai replied on the discussion topic How to add custom fields in Elgg entities
    Yes,  I have created the view. Not sure how/where the tag2 is getting linked with the entity. I am trying to understand the life cycle/process of adding a new field. I mean what are the places we need to modify in order to add a new field. view reply
  • rsai replied on the discussion topic How to add custom fields in Elgg entities
    I am trying to add an attribute (tag2)  in the above example tutorial. Please let me know of any issues 1. Add the following echo elgg_view('output/tags2', array('tags2' => $vars['entity']->tags2));   2. Add the following below... view reply
  • rsai replied on the discussion topic How to add custom fields in Elgg entities
    Thanks Shouvik. Would you be able to help out if I can send you the zip of the sample code? Also, is there any document explaning the data model of all the underlying MYSQL tables that it has created during the installation. view reply
  • rsai added a new discussion topic How to add custom fields in Elgg entities in the group Beginning Developers
    I am new to Elgg and trying to add some custom fields in Elgg Forms and trying to submit it to the database. I trie d adding new fields (example : tag2) to an example tutorial. I tried addding an attribute in views/pages and action similar to the...
    • Yes,  I have created the view. Not sure how/where the tag2 is getting linked with the entity. I am trying to understand the life cycle/process of adding a new field. I mean what are the places we need to modify in order to add a new field.

    • Please correct me if I am doing anything wrong here.

       

      1. Register the Entity in start.php

      <?php

      elgg_register_event_handler('init', 'system', 'my_blog_init');

      /**
      * Init blog plugin.
      */
      function my_blog_init() {

      elgg_register_library('elgg:my_blog', elgg_get_plugins_path() . 'bookmarks/lib/bookmarks.php');

      }

       

      2. Added the lib function in the lib/my_blog.php

      function my_blog_prepare_form_vars($my_blog = null) {
      echo "in lib";
      $values = array(
      'title' => get_input('title', ''), // bookmarklet support
      'description' => '',
      'tags' => '',
      'tags2' => '',
      'entity' => $my_blog,
      );

      ......

       

      }

       

      3. Added the entry in views/object/my_blog.php

      echo elgg_view('output/text', array('tags2' => $my_blog->tags2));

       

      4. Add the entry in the form save.php

      <div>
      <label><?php echo elgg_echo("tags2"); ?></label><br />
      <?php echo elgg_view('input/text', array('name' => 'tags2')); ?>
      </div>

       

      5. Added the following in the pages folder ( pages/my_blog/add.php)

      $vars = my_blog_prepare_form_vars();
      echo "vars = ".$vars;
      // add the form to this section
      $content .= elgg_view_form("my_blog/save" , array(), $vars);

       

      6. Added the following in actions ( actions/my_blog/save.php)

      $tags2 = get_input('tags2');

      $my_blog->tags2 = $tags2;  ( I cannot access tags2 here: tags2 not found in the Elgg Object).

       

      Not very clear on the life cycle or the process flow. Is there any good reference in understanding the process flow and any pointers on the above as to what is wrong?

       

      Any help is really appreciated.

       

    • sorry.. typo on the first step.

       

      elgg_register_library('elgg:my_blog', elgg_get_plugins_path() . 'my_blog/lib/my_blog.php');

  • rsai joined the group Elgg Technical Support