How to make a new profile block

I have figured out how to make a profile entry in forms and doing the jiggling about required, so i can make a profile field, have the field appear on 'edit profile' and then the information inputed by the user appear into the 'info' block on the 'profile info block'. This is great, things are coming together. But how do I make say, a info 2 block? With different info that i can put into a different space on the page?

image_transcoder.php?o=bx_froala_image&h=4064&dpx=1&t=1601235893

above is the block that is already there in the page profile info. I am able to put further fields into this so additional info can go into the profile. But if i wanted that info to go into a different block how would I go about this? This block is 'about' and in the 'add block' function on the page it comes under 'persons - info'. how would I essentially make a second block to hold more user info?

  • 1983
  • More
Replies (20)
    • Hello Little Pockets !

      The most proper way to do it - create the new service method where you will specify the rules of the appearance of the fields in this block. The easier variant is to create the new service block via Studio->Developer->Pages->Persons->View Person area with the content:

      array (

        'module' => 'bx_persons',

        'method' => 'entity_info',

      And hide the fewer fields with Javascript / CSS code in another raw block.

      • i could imagen some clever person could make some moeny making an app that does this automatically, I would think this is what people might want.

        • hi LeonidS, thankyou for your responce, how do i create a service method? I would like to be able to do things properly, or anyway really.

          • 'View Person area with the content: '  what is this sir? sorry how do i do this?

              • I alreay have eveloper installed, i am confused. I have been using developer for a while, i just don't know how to do the thing with creating the extra info block. I have tried sitcking new froms in, tried sitcking new displays in, tried, tried to do that thing that lennid sugrgested although i had no idea what he meant lol and still it didn't do anything, I suspect if i carry on like this i will break something and have to reinstall una completely, So I am asking how to, step by step make a new info block and make the form info go into that block. because one big info block just looks rubbish

                • Hi all!

                  So let's review the existing "Info" block has the value of service method as 'entity_info'. It means that BxPersonsModule class has the method serviceEntityInfo which "draws" this block. This method is declared in the parent BxBaseModGeneralModule class and has the following view:

                  public function serviceEntityInfo ($iContentId = 0, $sDisplay = false)

                      {

                          return $this->_serviceEntityForm ('viewDataForm', $iContentId, $sDisplay);

                      }

                  The code of method _serviceEntityForm:

                  protected function _serviceEntityForm ($sFormMethod, $iContentId = 0, $sDisplay = false, $sCheckFunction = false, $bErrorMsg = true)

                      {

                          $iContentId = $this->_getContent($iContentId, false);

                          if($iContentId === false)

                              return false;

                          bx_import('FormsEntryHelper', $this->_aModule);

                          $sClass = $this->_aModule['class_prefix'] . 'FormsEntryHelper';

                          $oFormsHelper = new $sClass($this);

                          return $oFormsHelper->$sFormMethod((int)$iContentId, $sDisplay, $sCheckFunction, $bErrorMsg);

                      }

                  So it means that it will load the ViewDataForm method of BxPersonsFormsEntryHelper class which has the following code (in the parent class BxBaseModGeneralFormsEntryHelper):

                  public function viewDataForm ($iContentId, $sDisplay = false)

                      {

                          $CNF = &$this->_oModule->_oConfig->CNF;

                          // get content data and profile info

                          list ($oProfile, $aContentInfo) = $this->_getProfileAndContentData($iContentId);

                          if (!$aContentInfo)

                              return MsgBox(_t('_sys_txt_error_entry_is_not_defined'));

                          // check access

                          if ($sMsg = $this->_processPermissionsCheckForViewDataForm ($aContentInfo, $oProfile))

                              return MsgBox($sMsg);

                          // get form

                          $oForm = $this->getObjectFormView($sDisplay);

                          if (!$oForm)

                              return MsgBox(_t('_sys_txt_error_occured'));

                          // process metatags

                          if (!empty($CNF['OBJECT_METATAGS'])) {

                              $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);

                              if ($oMetatags->keywordsIsEnabled()) {

                                  $aFields = $oMetatags->metaFields($aContentInfo, $CNF, $CNF['OBJECT_FORM_ENTRY_DISPLAY_VIEW']);

                                  $oForm->setMetatagsKeywordsData($iContentId, $aFields, $oMetatags);

                              }

                          }        

                          // display profile

                          $oForm->initChecker($aContentInfo);

                          return $oForm->getCode();

                      }

                  So, in the BxPersonsModule class, you may create a new method like serviceEntityInfoAdv (and call it in the block like 'entity_info_adv') which may combine the code from the given methods. So there you may define the list of necessary fields and remove it from $aContentInfo array.

                  • so, make a new module?

                    • Well, it is the most proper way especially if you want to add smth more. But you may also to create your own serviceEntityInfo method in the BxPersonsModule class, but in this case, you will lose the automatic upgrade of this module. Then you need to keep your changes manually every time after the force upgrade procedure.

                      • :( i still don't get it.

                        • You need to edit the modules\boonex\persons\classes\BxPersonsModule.php file and add after those lines:

                              return false;

                              }

                          the following:

                          public function serviceEntityInfoAdv ($iContentId = 0, $sDisplay = false)

                              {

                          // your own code to draw the special fields in the new info block

                              }

                          And call this method in the service block with the following content:

                          array (

                            'module' => 'bx_persons',

                            'method' => 'entity_info_adv',

                          • hey Little Pockets :)
                            whats your level of tech expertise? Una is not simple, but also not complicated. But- all things considered- it is not beginner. The cloud offering may be, however it's at a lack for customization I would imagine.
                            I first ran una, and like you, tweaked every knob, and so on- and had a lot of fun, felt like i was really getting somewhere, had a site working and creaaking along for a aaaa maybe two weeks? or so before i blew it up tweaking more buttons and knobs..
                            then i did something unexpected as the "why" kid. who literally grew up disassembling house hold electronics, toasters, microwaves, etc..
                            i just installed una. and left it alone. and used it.
                            and slowly, but surely- i noticed something that made me both really *&*&** mad at myself, and really brought a lot of laughter too.
                            all the stuff you are trying to do all up in here??  its all built in already just seriously stop you will drive yourself nuts or at least waste a lot of time,  just erase everything install it, and just try it all out for a month or so before you really turn any dials.  have fun :)

                            also, focus on initially getting most of the things on the server audit satisfied, however note there are some exceptions, like you can be totally running apache 2.x and it come up as 'undefined'  you are indeed running it, otherwise your site wouldnt show up.
                            speaking of, one last thing. wheres your site? ill join and kick the tires around as a new member. no judgement, just to get an idea of where you are at in your project/build... if you'd like. also, you may check out my una site- it's free- its www.mytribes.net
                            ~Omar

                            • heres a custom block i made for

                              that shows up for people who are unauthenticated, and then once they are logged in, it disappears.

                              This is to serve as an easy, visual indicator that you actually did manage to get logged in.  Which, is actually a major point of frustration for a lot of people, with websites- in general.  That, or the lost password that cannot be recovered.   Hint- set your una recovery threshold above the default of 6.  I've got mine at 12, and so far the rate of people who lock their accounts has dropped by a factor of 4 for the same period of time :)
                              https://linkmeow.com/screenshots/2020/oct/Screenshot_2020-10-03_16-21-37.png
                              image_transcoder.php?o=bx_froala_image&h=4087&dpx=1&t=1601767501

                              • Well thats a block thats made from the html block in dolphin una, I am trying to make something different thats not available in una, to make my own info blocks where users can input information into a form and it will appear on their profile info in a different block to the premade block. One block in never enough. I can already make new modules and make them appear on the studio as installable modules, I was just a bit stuck on how to make a second info block. UNA doesn't have the function already set up. It would be good if they could set something up like that but they havn't. So i am having to do it myself. Thanks to @LeonidS for pointing me in the right direction here.

                                • I wonder if i can do this in database...oh well here goese expect me to break something soon

                                  • LeonidS , I added the block using the above way. Also added the raw block but I haven't figured how to find the fields' name I want to hide. Also tried to hide the whole block using the below code but nothing happens. What am I doing wrong?

                                    • <style>

                                       .bx-page-block-104 {

                                       display: none;

                                          }

                                      </style>

                                      • Hello george1 !

                                        You set bx-page-block-104 as CSS class but it is a div ID. So it should be -page-block-104, not .bx-page-block-104

                                        • Great thanks, how about the individual profile fields? I have searched but haven't managed to find their ID. On the dev console all have the same id: bx-form-row-view-wrapper bx-form-row-view-wrapper-select bx-def-padding-sec-top

                                          • No, fields can't be selected by this way as they don't have IDs. You need to write the Javascript / JQuery code to hide the necessary fragments.

                                            Login or Join to comment.