CPSearch result adding Values from Article Attribs

  • hyperx
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 7 months ago #2227 by hyperx
Hi, is it possible to add values from the Article Attribs (#_content attribs). I am using the T3-Framework and have made an Extra Field for the Articles which act as a subtitle and is being stored in attribs. I have tried accessing this value but keep getting errors:

Notice: Undefined property: CustompropertiesViewSearch::$item in /www/htdocs/w00e40a7/pc-helfer/ego-new/templates/t3_bs3_blank/html/com_customproperties/search/default_item.php on line 13

Notice: Trying to get property of non-object in /www/htdocs/w00e40a7/pc-helfer/ego-new/templates/t3_bs3_blank/html/com_customproperties/search/default_item.php on line 13
Attachments:

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #2228 by andrea_4g
I notice the error originates from a template override (templates/t3_bs3_blank/html/com_customproperties/...).
I have no means to know what's written at line 13 of that files.

(at line 13 of administrator/com_custoproperties/views/search/tmpl/default_item.php, there are no instructions; only a php closing tag)

Please Log in or Create an account to join the conversation.

  • hyperx
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 7 months ago - 9 years 7 months ago #2229 by hyperx
Yes i am sorry, i forgot to attach the code.

line 13:
Code:
$attribs = new JRegistry($this->item->attribs);

line 17-20:
Code:
<?php if ($attribs->get('untertitel')) : ?> <span class="item-state state-<?php echo $attribs->get('untertitel') ?>"> <?php echo $attribs->get('untertitel') ?> </span> <?php endif ?>
Last edit: 9 years 7 months ago by hyperx.

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #2230 by andrea_4g
There's no 'attribs' property in Custom Properties item.
CP results items do have a subset of the properties of the original content item. This subset contains the most common variables (e.g. id, title, introtext, image, created date, access level, ..) found in all the content items CP supports: Joomla articles, K2 items, DocMan docs, jdownloads files, etc

Please Log in or Create an account to join the conversation.

  • hyperx
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 7 months ago #2231 by hyperx
Is there any easy way to add this? I have no idea on how to do this.

Please Log in or Create an account to join the conversation.

Time to create page: 0.170 seconds