solved Event image not showing on front page on JRElastic Skin

alt=
Luis456
@luis456
9 years ago
48 posts
Hello!

Could you please help me with the following. I would like to display the event List in the front page of JRElastic Skin.

I created an index_list_events.tpl and entered the below code, but it is only showing the event title and the user profile who created the event. I would like to show the event image with event details as the attached image.

{if isset($_items)}
  {jrCore_module_url module="jrEvent" assign="murl"}
  {foreach from=$_items item="row"}
   

          {if isset($row.Event_image_size) && $row.Event_image_size > 0}
              {jrCore_module_function function="jrImage_display" module="jrEvent" type="Event_image" item_id=$row._item_id size="small" crop="auto" alt=$row.Event_title title=$row.Event_title class="iloutline iindex"}
          {else}
              {jrCore_module_function function="jrImage_display" module="jrProfile" type="profile_image" item_id=$row._profile_id size="small" crop="auto" alt=$row.profile_name title=$row.profile_name class="iloutline iindex"}
          {/if}

      
      
          {$row.event_title}
      
  
  {/foreach}
{/if}
Could you please help with the code that I'm missing.

Thank You

--edit--
added [ code ][ /code ] block around the code.
- michael
events.png
events.png  •  80KB


updated by @luis456: 03/03/15 11:54:15PM
michael
@michael
9 years ago
7,744 posts
The best place to look for the list structure is in the module's item_list.tpl file. so for events thats at:
ACP -> MODULES -> PROFILES -> PROFILE EVENTS -> TEMPLATES -> item_list.tpl

You were almost there with your code, but you have a capital E in the variable names $row.Event_image_size and a few other locations. Use {debug} to find the correct variable names in the templates.

"{debug}"
http://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug

Here is some working code to get you going:
{jrCore_module_url module="jrEvent" assign="murl"}
{if isset($_items)}
    {jrCore_module_url module="jrEvent" assign="murl"}
    {foreach $_items as $item}
        <div class="container">
            <div class="row">
                <div class="col2">
                    <div class="block_image">

                        {if isset($item.event_image_size) && $item.event_image_size > 0}
                            {jrCore_module_function function="jrImage_display" module="jrEvent" type="event_image" item_id=$item._item_id size="small" crop="auto" alt=$item.event_title title=$item.event_title class="iloutline iindex"}
                        {else}
                            {jrCore_module_function function="jrImage_display" module="jrProfile" type="profile_image" item_id=$item._profile_id size="small" crop="auto" alt=$item.profile_name title=$item.profile_name class="iloutline iindex"}
                        {/if}
                    </div>
                </div>
                <div class="col10">
                    <a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.event_title_url}">{$item.event_title}</a><br/>
                    <span class="normal">{$item.event_date|jrCore_date_format:"%A %B %e %Y, %l:%M %p"}{if $item.event_end_day} {jrCore_lang module="jrEvent" id="64" default="-"} {$item.event_end_day|jrCore_date_format:"%A %B %e %Y, %l:%M %p"}{/if}</span>
                    {if isset($item.event_location) && strlen($item.event_location) > 0}
                        <br>
                        <span class="normal">@ {$item.event_location|jrCore_strip_html|truncate:60}</span>
                    {/if}
                    {if isset($item.event_description) && strlen($item.event_description) > 0}
                        <br>
                        <span class="normal">{$item.event_description|jrCore_format_string:$item.profile_quota_id|jrCore_strip_html|truncate:180}</span>
                    {/if}
                </div>
            </div>
        </div>
    {/foreach}
{/if}

p.s. Your code reads "If the event image has been uploaded, show that, if not, show the users profile image." Thats why your seeing the profile image.
alt=
Luis456
@luis456
9 years ago
48 posts
TankYou for your help..

Tags