How to change default controller of printcontainer


#1

Hi,

Recently I have upgraded Pimcore from 4.x to 5.x. While I’m adding a new print container under the documents section it is taking default controller as “web2print” but I want the default controller to be my custom controller which is “Web2print”. Where can I change the default controller and action of the print container.

Thanks.


#2

To set the default Controller/Action for all documents head over to the system settings and have a look at the documents section:
image

Another way (and I think the one you’re looking for) is to add a document type:
image

There you can also define your custom controller/action and then just add it in your document tree.


#3

Thanks for the information. But in Document settings default controller is “default” but when I add a new printcontainer I’m getting “web2print” as the default controller. It is not added under “Document Types” also. I’m totally confused here.


#4

Hi,
currently it is ‘hardcoded’ here: https://github.com/pimcore/pimcore/blob/c62924ca5c3d0c482a71097cb0231aff143208d6/models/Document/PrintAbstract.php#L42

BR
Christian


#5

Thanks a lot. But why would they hard-code controller name? Even action is also hard-coded.

https://github.com/pimcore/pimcore/blob/c62924ca5c3d0c482a71097cb0231aff143208d6/models/Document/Printcontainer.php


#6

it is the same as with the normal document pages:

it is to have reasonable fallback values.