Show fields from other models (collections) in keystone.js admin UI?

522 views
Skip to first unread message

Raed Marji

unread,
Feb 10, 2015, 4:50:05 AM2/10/15
to keyst...@googlegroups.com
I have asked about this on stackoverflow I would appreciate if I can get an answer from you guys :)
http://stackoverflow.com/questions/28428416/show-fields-from-other-models-collections-in-keystone-js-admin-ui

atlb...@gmail.com

unread,
Feb 10, 2015, 5:21:51 AM2/10/15
to keyst...@googlegroups.com
Please do not post links as a question.  Any answer I give will not have context for future readers and they should not have to click a link to understand.

In your Page model keyword and searchvol are the same thing, they will both always reference the _id(s) of the model item(s).  Even though you can have different values for each field, they will not reference a single field within a model, but the entire model item..

You want to use the map feature... http://keystonejs.com/docs/database/#lists-example
var Keyword = new keystone.List('Keyword', {
    map
: { name: 'searchvol' }
});


Raed Marji

unread,
Feb 10, 2015, 6:55:58 AM2/10/15
to keyst...@googlegroups.com
First of all, I understand that its better to put the context here. however I didn't to create multiple copies of this question around the web. and thought some1 could get some points on stack overflow in the process.

The questions till persists here, is how do I actually get the value of this mapping into the table. because I tried to do what you mentioned and it just changed the value of the name of the keyword to the value of the searchvol.

I want to be able add a reference a keyword, and have keystone admin UI grab any other attributes I might need that are related to that keyword, such as search volume.
Reply all
Reply to author
Forward
0 new messages