Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not finding images on portfolio block #4

Open
mhawke opened this issue Dec 2, 2015 · 4 comments
Open

Not finding images on portfolio block #4

mhawke opened this issue Dec 2, 2015 · 4 comments

Comments

@mhawke
Copy link

mhawke commented Dec 2, 2015

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.

@aembler
Copy link
Member

aembler commented Dec 3, 2015

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');

@mhawke
Copy link
Author

mhawke commented Dec 3, 2015

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
Copy link
Author

mhawke commented Dec 4, 2015

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?

@aembler
Copy link
Member

aembler commented Dec 4, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants