custom function or variables?

32 views
Skip to first unread message

kimeee

unread,
Aug 9, 2019, 10:44:11 AM8/9/19
to SIMILE Widgets
tried to find this info in documentation but haven't found it so far

wondering if it's possible to create a custom function or variable so that i don't have to add the same info for multiple records

example:  i have multiple professors that have the same assistant.  would like to be able to insert name of custom function containing assistant's contact info to each record instead of all the assistant's contact info for each professor.

thanks for any help


Luis Miguel Morillas

unread,
Aug 9, 2019, 10:52:54 AM8/9/19
to simile-...@googlegroups.com
Can you show the data structure you are using?  Use different types so each professor will have the id of its assistant

--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simile-widget...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simile-widgets/f4b3ee0f-088f-4643-bfe3-3af25b7f93db%40googlegroups.com.

kimeee

unread,
Aug 9, 2019, 2:11:03 PM8/9/19
to SIMILE Widgets
But for every entry I'd still need to add the assistant's name and info to "type".  What I'm looking for is to be able to only enter a variable say that stands for the particular assistant that will call that assistant's info.

Either way here's data:

{"items" : [
{
"type" : "Physics",
"area" : "Condensed Matter Experiment",
"relationship" : [
"Faculty",
"All Faculty"
],
"title" : "Professor",
"name" : "First Last",
"gender" : "M",
"asst" : "First Last",
"asstphone" : "(617) 555-5555",
"asstemail" : "em...@email.com"
},
{
"type"  : "Physics",
"area"  : "Condensed Matter Experiment",
"relationship"  : [
"Faculty",
"All Faculty"
],
"title"  : "Professor",
"name"  : "First Last",
"gender" : "M",
"asst"  : "First Last",
"asstphone" : "(617) 555-5555",
"asstemail"  : "em...@email.com"
},
{
"type"  : "Physics",
"area"  : "Condensed Matter Experiment",
"relationship"  : [
"Faculty",
"All Faculty"
],
"title"  : "Professor",
"name"  : "First Last",
"gender" : "M",
"asst"  : "First Last",
"asstphone" : "(617) 555-5555",
"asstemail"  : "em...@email.com"
      ]
 }

On Friday, August 9, 2019 at 10:52:54 AM UTC-4, Luis Miguel Morillas wrote:
Can you show the data structure you are using?  Use different types so each professor will have the id of its assistant

El vie, 9 de agosto de 2019 16:44, kimeee <kimee...@gmail.com> escribió:
tried to find this info in documentation but haven't found it so far

wondering if it's possible to create a custom function or variable so that i don't have to add the same info for multiple records

example:  i have multiple professors that have the same assistant.  would like to be able to insert name of custom function containing assistant's contact info to each record instead of all the assistant's contact info for each professor.

thanks for any help


--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simile-...@googlegroups.com.

Luis Miguel Morillas

unread,
Aug 10, 2019, 6:52:18 AM8/10/19
to simile-...@googlegroups.com
I think that you should think on a different data structure and use collections:

Main collection:
<div data-ex-role="exhibit-collection" data-ex-item-types="professor"></div>

Data:

{"items" : [
{
"fac" : "Physics",
"area" : "Condensed Matter Experiment",
"relationship" : [
"Faculty",
"All Faculty"
],
"title" : "Professor",
"name" : "First Last",
"gender" : "M",
"asst" : "assitant label or id",
"type": "professor"
},
{
"fac" : "Physics",
"area" : "Condensed Matter Experiment",
"relationship" : [
"Faculty",
"All Faculty"
],
"title" : "Professor",
"name" : "First Last",
"gender" : "M",
"asst" : "assitant label or id",
"type": "professor"
},
{
"fac" : "Physics",
"area" : "Condensed Matter Experiment",
"relationship" : [
"Faculty",
"All Faculty"
],
"title" : "Professor",
"type": "professor",
"name" : "First Last",
"gender" : "M",
"asst" : "assitant label or id"
},
{ "label" : "First Last",
"asstphone" : "(617) 555-5555",
"asstemail" : "em...@email.com",
"type": "assistant"
}
]
}

Remember that all the items must have a unique label or id



-- luismiguel (@lmorillas)
> To unsubscribe from this group and stop receiving emails from it, send an email to simile-widget...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/simile-widgets/d469e6ac-fc7e-4422-bafb-33a3c4b716d3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages