Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Problem with images in list contents #48

Open
albertocs opened this issue Oct 7, 2011 · 0 comments
Open

Problem with images in list contents #48

albertocs opened this issue Oct 7, 2011 · 0 comments

Comments

@albertocs
Copy link

Hi.

I'm trying to change a field in one table. I want to show an image, but I can see only text. I've edited the DoctrineORMFieldGuesser.php adding theese lines:

case 'image':
$options[] = new FieldOptionGuess(
'image',
'WhiteOctoberAdminBundle::fields/image.html.twig',
FieldOptionGuess::HIGH_CONFIDENCE
);
$options[] = new FieldOptionGuess(
'formType',
'image',
FieldOptionGuess::LOW_CONFIDENCE
);

I have created this twig file:

<img
src="{{asset('pictures/media/'~value)}}"

alt="{{value}}" width="150px" />

I have changed the XAdmin.php file, too:


public function configureFieldsByAction(ActionInterface $action, FieldConfigurator $fieldConfigurator)
{
// selection action by name
if ('list' == $action->getName()) {
$fieldConfigurator->get('logo')->setOption('template','WhiteOctoberAdminBundle:fields:image.html.twig');
//$fieldConfigurator->get('logo')->setOption('label', '...');
// changing options
// $fieldConfigurator->get('linkViewMore')->setOption('label', '...');
}

}

Anyone could help me? I can't see images :s I see only the source code: "".

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

No branches or pull requests

1 participant