Is overriding Pimcore Pdf Model supported?

Is overriding \Pimcore\Model\Document\Tag\Pdf supported as documented in
guide? (For some reason my implementation is never called)…

If not supported, how to get pdfreactor to render pdf asset correctly so that the asset gets embedded into the resulting document? With default \Pimcore\Model\Document\Tag\Pdf::frontend() implementation (the method I would like to override) the outcome is empty thumbnail placeholder with an invalid link. So the pdf asset is not printed in the resulting pdf.

Here’s the changed part of my pimcore implementation to fix the issue:

$code = <<<HTML <div id="$divId" class="pimcore-pdfViewer"> <img src="$pdfPath" /> </div> HTML;

But my overrided pimcore pdf model is never called and I wouldn’t like to fork the pimcore…

it is not supported by the overriding models functionality (since the editable is no model), but you can add custom editables with this guide.
So, it also should be possible to overwrite existing editables by just providing your custom implementation for an core editable in the configuration (step 2 in guide).


Yet again same issue but this time I’d like to override Pimcore\Model\Document\Tag\Relations::getDataEditmode method and not quite sure how to provide my own custom editable to do so cause the current editable is already my own and extends Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick. Any suggest @fash?

I cannot really follow you. If it is already your own editable, you should be able to overwrite getDataEditmode ?!


Sorry @fash I did post invalid namespace and class in previous post. It appears that Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick is somehow using Pimcore\Model\Document\Tag\Relations::getDataEditmode method but I cannot find the call of this method from Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick so that I could overwrite it…

just use debugger and see where it comes from. Has to be somewhere in your template/document, that uses a relations tag somewhere (maybe some old content?).
It is not something generic to pimcore.


Actually Pimcore\Model\Document\Tag\Relations::getEditmode is called from \Pimcore\Templating\PhpEngine::relations method in my php view :thinking:

So @fash when I do call the relations method of Pimcore\Templating\PhpEngine in my view it will cause the call of Pimcore\Model\Document\Tag\Relations::getEditmode. However I cannot find implementation of the Pimcore\Templating\PhpEngine::relations method as the pimcore editable/method is magically annotated to be part of class Pimcore\Templating\PhpEngine.

@method Tag\Relations relations($name, $options = [])

Why would you call Pimcore\Templating\PhpEngine::relations()?

To provide a grid into which drag’n drop data objects and by overriding getEditmode I’m about to apply some changes to the grid data @fash

Possibility to override the pdf model would also help to solve this issue