addon_migration_tool_legacy icon indicating copy to clipboard operation
addon_migration_tool_legacy copied to clipboard

Not finding images on portfolio block

Open mhawke opened this issue 10 years ago • 4 comments

I have a custom 'portfolio' block that has a 'screenshot' image grabbed by the File Manager through the helper and saved as a fID in the block's db table. The exported XML properly inserts the fID in a tag called < screenshot >345</ screenshot > but the export function reports no image files on the page to be downloaded separately. At first I thought it might have been that I was assigning the image in the CSS as 'background-image' but I am not. The view.php creates an < img > tag.

mhawke avatar Dec 02 '15 16:12 mhawke

You need to add some code to your block controller that tells the export that the screenshot field is an exportable image field. This will cause the file ID to be replaced by a placeholder to the image in question ({ccm:export:image:image_filename.jpg}) which will then list the image in the export list, and make it so that it'll be properly replaced when it comes time to import the content.

This can usually done by simply adding the field to an array you define in your block controller named $btExportFileColumns. For example, the image block controller has this:

protected $btExportFileColumns = array('fID','fOnstateID');

I think adding this to your block controller would do the trick:

protected $btExportFileColumns = array('screenshot');

aembler avatar Dec 03 '15 19:12 aembler

Wonderful! Works like a charm.

Is this the only type of thing that needs to be defined in the controller or are there other elements that need the same treatment?

mhawke avatar Dec 03 '15 20:12 mhawke

Sorry to keep posting stuff here but I can't install the 5.7 side of this thing until I can get my hands on version 5.7.4a1. I have no time to set up a fully-working, development stack for 5.7 so do I have to wait for you folks to release this version?

mhawke avatar Dec 04 '15 03:12 mhawke

Probably. It shouldn't be long. We have a number of fairly important issues we've noticed from 5.7.5.3 that we're hammering out and we'll do another release.

aembler avatar Dec 04 '15 23:12 aembler