New members in Showcase View

I would have liked to add a block with new members in Showcase View. I put the following code based on the "Featured People (Showcase View)" block, but I have no change, why does not it work?

array (
  'module' => 'bx_persons',
  'method' => 'browse_recent_profiles',
  'params' => 
  array (
    'unit_view' => 'showcase',
    'empty_message' => false,
    'ajax_paginate' => false,
  ),
)
  • 546
  • More
Replies (13)
    • Please how to get this?

      • Hello Baloo!

        On a quick view, your code looks fine. So you may for checking to enable this block in homepage too - will it provide there the same result?

        With the best regards, Leonid

        • Hello Leonid, well no, the code does not work, it shows the block in an ordinary way. Can you test it please?

          • From my side it is enabled fine - I can see this block. But please specify "it shows the block in an ordinary way" so you mean it works but doesn't respond to the parameters which you set there?

            • Yes Leonid, it works but I have a result identical to the original block "new members", in fact, it looks like it does not take into account the second array ...
              Is not it because of the parameter in person -> settings -> Number of items per page = 6?

              • As I checked in the code of public function serviceBrowseRecentProfiles ($bDisplayEmptyMsg = false) - it doesn't take any parameters like you made in the record. So you need processing of them to this method with the example from albums serviceBrowseRecentMedia method.

                • Hello Leonid, I do not quite understand your answer, you could indicate the complete code so that it works please?

                  • Hi again!

                    So, see this method for profiles:

                    public function serviceBrowseRecentProfiles ($bDisplayEmptyMsg = false)
                    {
                    return $this->_serviceBrowse ('recent', false, BX_DB_PADDING_DEF, $bDisplayEmptyMsg);
                    }

                    and this one for the Albums:

                    public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
                    {
                    return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
                    }

                    You may see that in the second case we have the processing of additional parameters. So you need to change serviceBrowseRecentProfiles something like:

                    public function serviceBrowseRecentProfiles ($aParams = false)
                    {

                    if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedBrowse()))
                    return MsgBox($sMsg);

                    bx_import($sClassSearchResult, $this->_aModule);
                    $sClass = $this->_aModule['class_prefix'] . $sClassSearchResult;
                    $o = new $sClass($sMode, $aParams);

                    $o->setDesignBoxTemplateId($iDesignBox);
                    $o->setDisplayEmptyMsg($bDisplayEmptyMsg);
                    $o->setAjaxPaginate($bAjaxPaginate);
                    $o->setUnitParams(array('context' => $sMode));

                    if ($o->isError)
                    return '';

                    if ($s = $o->processing())
                    return $s;
                    else
                    return '';

                    }

                    and in the code, you will need to process these variables like unit_view

                    • Thank you very much Leonid for these valuable explanations. Just wonder why you offer this opportunity without effort for featured members and not for new members.
                      In fact not long ago I noticed this style of view which the big advantage is an obvious gain of space and I noticed a little later that it could even be swept with the finger, a must.
                      Well, I think it's really great and it would be super cool to include this possibility for all the blocks as far as possible, because we often lack space on a screen and even more on a mobile.
                      Unless this style of view consumes more resources, why not abuse this great idea?

                      • You are welcome, Baloo! This is just an example of the one possible solution, so, for now, I guess no need to expand this part more :-)

                        • No Leonid, I think you misunderstood me, I meant to extend this possibility to other blocks, in UNA, not here ..

                            • Great, thank you

                              Login or Join to comment.