These are chat archives for collectiveaccess/support

10th
May 2016
mrjayviper
@mrjayviper
May 10 2016 04:37

help please when using display templates.

there is an intrinsic (cannot find it in the meta element list) field called Object related entities. I want to use it on a display template/format but I do not know what to use (example: ^ca_objects.related_entities) since it's intrinsic. can someone please help? thanks

ps. seems ^ca_objects.my-field-here has not direct relationship to actual database table fields? I asked since I --successfully-- used ^ca_objects.previous_numbers in a display template/format and I looked into the MySQL table called ca_objects and no previous_number field exists. thanks again

mrjayviper
@mrjayviper
May 10 2016 04:49

more help please. thanks! :)

1st image (http://i.imgur.com/c4Mv4W7.jpg) shows the an object's info via the acquisition section. As can be seen, the acquisition method is selected as "purchase".
2nd image (http://i.imgur.com/R7IsZpY.jpg) shows the summary of the object using a custom display. But the problem is that acquisition method is empty.

any ideas what could be wrong? I looked at the custom display and there's no display formatting property to acquisition method possibly because it's a list. the only thing I can change is the label. thanks very much again

mrjayviper
@mrjayviper
May 10 2016 05:31
another question please! There is a dimensions container which I believe comes part of the default install. Anyway, I have an object that has multiple dimensions possibly because it is made up of many pieces.
this is dimension data as seen: http://i.imgur.com/2inHqGs.jpg
this is the dimension data as seen from a custom display: http://i.imgur.com/hlirQPk.jpg
as you can see all the height info has been bundled into 1. This is the display format I am using: height: ^ca_objects.dimensions.dimensions_height | width: ^ca_objects.dimensions.dimensions_width<br>
Is it possible to perhaps make the summary display dimension in this format instead:
26.4cm x 20.7cm
45.5cm x 30.4cm
26.6cm x 20.8cm?
mrjayviper
@mrjayviper
May 10 2016 05:37
I am looking at the display template wiki and nothing stands out
GautierMichelin
@gautiermichelin
May 10 2016 10:46
Hi
I've been meeting lately a problem on storageLocationHierarchyBuilder, creating duplicates in the hierarchy as I use it with options > useParentAsSubject and refinery parameters > parents ; on a master-fix version
Stefan
@stefankeidel
May 10 2016 12:18
@mrjayviper There is extensive documentation on display templates here, including how to pull data through relationships: http://docs.collectiveaccess.org/wiki/Display_Templates .. to get just the names of related entities you could use ^ca_entities.preferred_labels.displayname. If you need more than one data point for each related record, you'll need to make it a <unit>. For your third question, you'll also have to look at units.
For the second question, what's the template behind that acquisition method bundle placement? And are you sure it's the same field?
michalfrankl
@michalfrankl
May 10 2016 14:48
Hi, is there a documentation somewhere on how to import data into interstitial fields via a PHP script? Thanks.
GautierMichelin
@gautiermichelin
May 10 2016 14:54
Hi Michal, I've played with xlsx mappings and normal import, intersitial fields are coming through the usual splitters. I can share my mapping and a data sample if you want to compare. For PHP, it's done through things like$t_subject->addRelationship($vs_table_name, $vn_rel_id, $vs_rel_type, null, null, null, null, array('interstitialValues' => $va_element_data['_interstitial'])); [ca_data_importers L 2469]
michalfrankl
@michalfrankl
May 10 2016 14:59
Thanks - I'll give it a try and will come back if I have a problem! At the moment, I just need the PHP code, but we might be playing with xlsx mappings at a later point too.
GautierMichelin
@gautiermichelin
May 10 2016 15:02
if you want to have a look at what is in charge with those interstitials, you'll find inside L 6657 of app/lib/ca/BundlableLabelableBaseModelWithAttributes.php : see private function _processInterstitials($pa_options, $t_rel, $pb_update) { [...] }
michalfrankl
@michalfrankl
May 10 2016 15:10
OK, thanks!
Stefan
@stefankeidel
May 10 2016 15:52
The normal helper methods like addAttribute() and co all work on relationships as well because the relationship tables are BundlableLabelableBaseModelWithAttributes too!
GautierMichelin
@gautiermichelin
May 10 2016 18:34
Thanks for the tip Stefan, with id of the relationship, all the usual stuff are available.
Just by curiosity, is there a helper somewhere to bring back from a record not other related records but the relationships ids ?
Stefan
@stefankeidel
May 10 2016 22:30
Not sure I follow. You mean something like $t_object->get('ca_objects_x_entities.relation_id)?