1

I'm using entity_print for PDF generation on two node types. I'd like each to have its own orientation configuration (or just have one override the default). There is an event in entity_print where configuration can be set at run-time, so I have a simple event subscriber, with a method to override the orientation, but I can't seem to get the last piece, which is the entity (bundle label) to switch on.

How can an event subscriber have access to the entity type?

  • 1
    You have an entity object in code? You should have a bundle() method to return the type. Node also has the convienient method getType() for node objects to get their node type. – Kevin Nov 17 '17 at 22:40
  • @Kevin That's the problem, the event object is only storing the type of the print object, not the object being printed. I think upon further investigation, I may actually need to subscribe to a pre-send event to get this. – steve Nov 18 '17 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.