I am trying to show entries and I only have 2 items added. The problem is that its repating same entries about 7 times, I not a programmer but this I tried to make. Can anyone help please.
Code: Select all
<!-- Summary Template -->
var config = [<br />
{if $items|@count > 0}
<!-- items -->
{foreach from=$items item=item}
<!-- item -->
{if !empty($item->fielddefs)} <!-- field definitions -->
{foreach from=$item->fielddefs item=fielddef}
{if $fielddef.type == 'Categories' && ($fielddef.value != '')}
{LISELoader item='category' force_array=1 value=$fielddef.value assign='cats'}
{assign var="qtheme" value={implode(',', $cats)}} <!-- categories //-->
{/if}
{ level:"{$item->level}", theme: "{$qtheme}", question: "{$item->title}", answers: [ "{$item->answer1}","{$item->answer2}","{$item->answer3}","{$item->answer4}" correct: {$item->correct} ]}, <br />
{/foreach}
<!-- field definitions //-->
{/if}
<!-- item //-->
{/foreach} <!-- items //-->
{/if}
<br />
];
Code: Select all
<!-- outout -->
var config = [
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
];
Code: Select all
<!-- outout should be -->
{ level:"1", theme: "Learning Disability", question: "Approximately how many people in the uk have a learning disability?", answers: [ "1.5 million","500 thousand","3.5 million","850 thousand" correct: 4 ]},
{ level:"1", theme: "Learning Disability", question: "A learning disability is a lifelong condition that develops around the time of birth?", answers: [ "True","False","","" correct: 1 ]},
so I want sometining like
Level 1 Learning Disability ...
Level 1 Learning Disability ...
Level 1 Autism ...
Level 1 Autism ...
Level 2 Learning Disability ...
Level 2 Learning Disability ...
Level 2Autism ...
Level 2 Autism ...
Thank you very much