9 years ago
16
Topic

Hello, i will Display the Checkbox Image in the Content view.

i have with onebeforerender this code crated:

foreach ( $images as $image ) {
$value .= '<li><img src="/images/auswahl/'.$image.'"/></li>';
}

but the value dont output. in the Content view i see only images/auswahl and a error Picture :(

Can you help me to find my issue? Tank you

Get a VIP membership
9 years ago
4
Level 1

sorry this is my full code:

$images = explode( ',', $fields['ausstattung']->value );
$value = '';
foreach ( $images as $image ) {
$value .= '<li><img src="/images/auswahl/'.$image.'"/></li>';
}
$fields['check_text_feld_out']->value = '<ul>'.$value.'</ul>';

9 years ago
3
Level 2

Hi essge,

I suppose that you are in a form view, so the property to fill is the "form" :

$fields['check_text_feld_out']->form = '<ul>'.$value.'</ul>';


Best regards.

Lionel

9 years ago
2
Level 3

Hello, thanks for your answere.

I have test this now, and it doesnt go :(

$images = explode( ',', $fields['ausstattung']->value );
$value = '';
foreach ( $images as $image ) {
$value .= '<li><img src="/images/auswahl/'.$image.'"/></li>';
}
$fields['check_text_feld_out']->form = '<ul>'.$value.'</ul>';

it Display nothing :( what ist wrong with the code?

Thank you

9 years ago
1
Level 4

Hi essge,

difficult to answer you precisely.

Which kind of field is $fields['ausstattung'] ?

What can you see with firebug in the view ?

Are you sure that you have some values in the field $fields['ausstattung'] ?


Best regards.

Lionel

9 years ago
0
Level 5

Hello the

$fields['ausstattung'] is a Checkbox field, and i have here the values (A = picture1.jpg B = picture2.jpg....) And now i will Display it in the Content view. Firebug Shows me no Errors.

thank you

9 years ago
6
Level 1

Hello essge,

which storage have you set for this field ?

are you sure that data are well stored ?

In the Options of the checkbox, be sure to not have spaces at the right of the =


Best regards.

Lionel

9 years ago
5
Level 2

Hello, in the options i have not spaces, example a=picture1

the storage is: custom article introtext

thank you

9 years ago
4
Level 3

Hi essge,

so it's normal.


Please, have a look to the tutorial below.

Like written in this tutorial, in 99% of case, use the standard storage


Best regards.

Lionel

9 years ago
3
Level 4

Thank you for your answere

now i have set it to standart, but it dont go :(

9 years ago
2
Level 5

Hi essge,

if you have just change the storage from custom to standard, it's normal that it's not working, because you are storing in the introtext column.

SEBLOD use this column to store the ID for the bridge between Joomla! and SEBLOD.

The best thing to do is to delete your field and create a new with a good storage : standard | article | your_column_name


Best regards.

Lionel

9 years ago
1
Level 6

Hi Lionel,

Thank you for your answere

i have test this now, i have delete the field and then i have create a new field with the Setting you say. but it dont working :(

9 years ago
0
Level 7

Hi Lionel,

Thank you for your Help, no i have solved it :)

1. I have use zhis code:

$images = explode( ',', $fields['ausstattung']->value );
$value = '';
foreach ( $images as $image ) {
$value .= '<li><img src="/images/auswahl/'.$image.'"/></li>';
}
$fields['check_text_feld_out']->form = '<ul>'.$value.'</ul>';

2. in the Content i have add the checkboxfield Ausstattung with clear <---- this was the solution

now it works an the Images displaying in the check_text_field_out :)

332 Posts
Kenneth
9 years ago
1
Level 1

Try changing your code. I just created a working code for this, without images, but from checkbox field.

$type_hjelp = $cck->get('ressurs_type_hjelp')->text; // Set the value first 
$type_hjelp2 = explode(',',$type_hjelp,30); // Then explode it

<?php foreach($type_hjelp2 as $type_hjelp3){ ?>
<div><span><?php echo $type_hjelp3; ?></span></div>
<?php } ?>

9 years ago
0
Level 2

Hello, thanks for your answere, but with this code i have a error

Parse error: syntax error, unexpected '<'

 in line 5

332 Posts
Kenneth
9 years ago
1
Level 1

Please show me what your line 5 is.

9 years ago
0
Level 2

Hello this is the line 5

plugins/cck_field/code_beforerender/code_beforerender.php(164) : eval()'d code on line 5

Get a VIP membership