Template parsing question

Here's the contents of /modules/boonex/sounds/templates/base/thumb.html

<div class="sys_file_search_pic" style="background-image: url('__imgUrl__');">
    <bx_if:admin>
        <div class="bx_sys_unit_checkbox">
            <input type="checkbox" name="entry[]" value="__id__"/>
        </div>
    </bx_if:admin>
    <a href="__fileLink__"><img src="__spacer__"></a>
</div>

 

That __id__ key only parses when it is within the bx_if:admin tags.  Anybody know what I have to do to be able to use it as an id for the main div, so when it parses the div will have a unique id?  I tried a few things in BxBaseSearchResultsSharedMedia.php with no luck. 

I want a random background image for sounds thumbs as shown HERE but since every div has the same id, the background image is the same for each thumb. ( Refreshing the page will change the bg image)  The only way to get this to work right, is for each thumb div to have a unique ID.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 30 Jul 2012

edit BxBaseSearchResultSharedMedia.php at line 330 add this

'ID' => $iId,

so it will look like this

$aUnit = array(

            'imgUrl' => $this->getImgUrl($sIdent),

            'spacer' => getTemplateIcon('spacer.gif'),

            'fileLink' => $sFileLink,

            'ID' => $iId,

            'bx_if:admin' => array(

                'condition' => $this->bAdminMode,

                'content' => array('id' => $iId)

            )

        );

Use __ID__ in template.

Good luck :)

so much to do....
Quote · 30 Jul 2012

 That's one of the things I already tried.  It doesn't work.   When the page is served up, it remains as __ID__, not the actual id number of the file.

 

edit BxBaseSearchResultSharedMedia.php at line 330 add this

'ID' => $iId,

so it will look like this

$aUnit = array(

            'imgUrl' => $this->getImgUrl($sIdent),

            'spacer' => getTemplateIcon('spacer.gif'),

            'fileLink' => $sFileLink,

            'ID' => $iId,

            'bx_if:admin' => array(

                'condition' => $this->bAdminMode,

                'content' => array('id' => $iId)

            )

        );

Use __ID__ in template.

Good luck :)

 

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 30 Jul 2012

OK... it's another case of self-inflicted injury. 'ID' => $iId, works if I out it in the correct file.  Seems as though about 2 years ago, I modified this class in my templates /scripts/BxTmplSearchResultsSharedMedia.php file, and that's where this has to go.

Now it all works.   I just need to design some better looking background images... not real happy with my first try.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 30 Jul 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.