Developer Question: override for title

Hello UNA,

I am trying to add a column from the database to my modules unit_gallery boxes.

It has __title__ already, and I want to add __sign__ in front of it.

I figured how to add and override meta menu, but can't quite track the where you parse the __title__ at.

If you just send me where to look, I'd be grateful. Thank you!

  • 1811
  • More
Replies (3)
    • I can also use __id__ and __text__ - but not my custom one. Is there somewhere in the database I need to add my column?

      • Hello @Wise !

        Usually, similar variables are processed in the unit method of the module's template class. What was the "parent" of your custom app?

        • I got lost in the web of UNA. As a java developer, UNA gives me stress headaches. It is sometimes it is easy, othertimes I'm a 'grep' and a few Monsters (energy drink) away from losing my mind.

          I accomplished my task by overriding in my SearchResult class of my module:

            function displayResultBlock ()
            {
              $aData = $this->getSearchData();
          
              $sCode = '';
              if (count($aData) > 0) {
                $sCode = $this->addCustomParts();
                foreach ($aData as $iKey => $aValue) {
                  $sCode .= str_replace('__sign__', $aValue['sign'], $this->displaySearchUnit($aValue));
                }
              }
              return $sCode;
            }
          

          There maybe a easier way, or a more correct way, but at the expense of my sanity, I'm done looking. And actually, it works great.

          Obviously, I simply do a str_replace on each entry, so it works.

          Login or Join to comment.