Jump to content

Record ID


Wildcard Chris

Recommended Posts

Hey guys,

I have a record database setup that I'd like to be able to search by record ID (in the regular search box). My idea was to create a custom field that used the record ID $databaserecordID or something along those lines. Does anyone have any ideas, or know exact what the $class is for the ID itself?

Thanks!

EDIT: I figured out how to do it :) 

Link to comment
Share on other sites

15 hours ago, Jimi Wikman said:

Care to share Chris?

Might help others who want to try something similar in the future?

Also let us know what you are building when you are done so we can drop by and get inspired :)

I figured out how to get the record ID to show and placed it in the record template under the title:

<div class='ipsType_break ipsContained'>{$record->_title}</div>
       {{if $record::$customDatabaseId == "24"}}
      <div style="color:#fff;font-size:14px;">Incident# {$record->primary_id_field}</div>
		{{endif}}

Which shows like this:

https://gyazo.com/0da3ed632ae336431d769dcba9559c72

But now I'm still trying to figure out how to make it searchable. As from what I know the search only searches within Content|raw and the title.

Link to comment
Share on other sites

1 hour ago, Wildcard Chris said:

from what I know the search only searches within Content|raw and the title.

Yep, that's correct. I know 4.3 expands search to other elements which weren't included before (products in Commerce, I think) but database fields other than title and content haven't been possible.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...