Question about displaying XObject from other page

I’ve created a wiki similar to your FAQ example. I have an Article page that can contain multiple instances of my custom QuoteClass (which is like your FAQClass, but more complicated).

From another page, I do a solr query, find the Article page I want and the particular instance of QuoteClass that I want to display on this other page. I want it to look the same way as it does on the Article page. So in my velocity code, I would like to call $articleDoc.display($quoteObject). But the display() method in the Document class requires a “fieldname”. I don’t know what the “fieldname” of this Object is on this document - it’s buried down within some Collection of QuoteClass objects on the page.

Is there a way to get a particular Object’s fieldname on a given Document?

And I guess more generally, I don’t understand why a fieldname is required to display a given Object in a Document.

Thanks!

There’s no API to display an object, there are only APIs to display object properties. Your QuoteClass must have some properties, which are “inherited” by all instances (objects) of this class. So when you want to display an object of type QuoteClass you actually have to display all (or some, your choice) object properties. The FAQ tutorial has some snippet to display an object by displaying all its properties.

Yes, I see now, thanks!