How to add a varibale that can be access on the documents templates

Hello, I would like to know how to create a variable that can be accessed in the documents template. I want to create a template that has items from more than one order,  so I wanted to do all the sorting in the controller and then create a variable that can be sent or accessed int he documents template like the {$Order} and other variables are. I saw the tutorial on creating global variables and I followed it well, however it can create a variable that can be found in the frontend templates of the theme but not the document templates. i also cannot use the {debug} on documents to see if the varibales are shown anywhere. When i use {$custom_variable|print_r} to try and display the contents of the custom variable i only get a response of 1. so I wanted to ask if what I want to do is possible or there is a better way of doing this? 

Any help is much welcome. 

Thank you in advance.

You can add varrible like that for template 

$view->assign(‘someCustomVar’,‘xxxxxx’);

@ansarhusain schrieb:

You can add varrible like that for template 

$view->assign(‚someCustomVar‘,‚xxxxxx‘);

i have already tried this inside a controller and also inside a class that i created to create documents. Or maybe i am just putting in the wrong files.   

This is a short example on how to add addional information to documents via plugin: GitHub - mnaczenski/MNAddDocumentImages

2 „Gefällt mir“

@Moritz Naczenski schrieb:

This is a short example on how to add addional information to documents via plugin: https://github.com/mnaczenski/MNAddDocumentImages

Thank you very much. that example worked wonders for me.  I was getting it wrong from here. 

'Shopware_Components_Document::assignValues::after'