N
N
Nikolai Gromov2018-09-18 07:54:32
PHP
Nikolai Gromov, 2018-09-18 07:54:32

Why is only one drawing displayed?

Hello!
There is such code in the view.

{foreach name=thumbProject from=$thumbProjects item=thumbProject}
     <div class="row">
           <div class="col mb-1">
                 {foreach name=project from=$projects item=project}
                      {if ($thumbProject->id == $project->thumbprojectId)}
                          {if $smarty.foreach.project.first}
                              <a class="fancybox-thumbs" title="{$project->title}" data-fancybox-group="thumb{$smarty.foreach.thumbProject.iteration}" href="/images/projects/{$project->projectFoto}">
                                   <img class="d-block w-100 kursor" src="/images/projects/thumbs/{$thumbProject->thumbFoto}" alt="{$thumbProject->thumbTitle}" />
                              </a>
                         {else}
                               <a class="fancybox-thumbs" title="{$project->title}" data-fancybox-group="thumb{$smarty.foreach.thumbProject.iteration}" href="/images/projects/{$project->projectFoto}">
                               </a>
                          {/if}
                     {/if}
                {/foreach}
           </div>
     </div>
{/foreach}

Two variables are passed to the view. One with small photos and titles for them, the second with large ones. I can't understand why I only see the first small photo? If you look at the page code, you can see that in the following lines large photos are written and there are no small ones.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2018-09-18
@alexey-m-ukolov

Ahem...
{if $smarty.foreach.project.first}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question