Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
JR5 Help Guide
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 08/17/13 12:17 
Brian helped me out today and explained some info on JR5 so I thought I would share. Brian please correct this thread if anything is incorrect.

Most of us were on JR4 prior so one of the major changes was that before we used a header, row and footer template, JR5 uses one template with a loop.

In this example, I added a custom form field called "blog_custom_form" that is a check box. If that check box is clicked, image1 will show. If the box is not checked, image2 will show. I used the variable {if $item.blog_custom_form == "on"} to look for the value from the blog.

jrCore_module_function function="jrImage_display" - This will post the blog posted user image and link it when clicked to a specific page


If you look at the jrCore_list module="jrBlog", I am returning 1 value by the latest entry in a specific quota with a specific category.

So what does this do? Every time the page is loaded, the loop will run and look for a blog by quota, category and will look at the checkbox to determine what image to display.

The foreach loop - {foreach from=$_items item="item"} - is extremely important because it will determine the output. The $item variables will only work inside the loop. If I move the foreach loop down below the conditional call for which image to use, the correct image will not display because $item.blog_custom_form will not get loaded.


Code

{capture name="template" assign="template"}
{literal}


{foreach from=$_items item="item"}
{if $item.blog_custom_form == "on"}

<div align="center"><a href="{$jamroom_url}/link"><img src="{$jamroom_url}/skins/skin/img/image1.gif" width="180" height="148"></a></div>

{else}
<div align="center"><a href="{$jamroom_url}/link"><img src="{$jamroom_url}/skins/skin/img/image2.gif" width="180" height="148"></a></div>
{/if}
<div id="spacer-10px"></div>


    <div align="center">
    <a href="http://www.site.com/template">{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$item._user_id size="large" alt=$item.user_name class="img_shadow img_scale"}</a>
    </div>
    <div id="spacer-10px"></div>
    <H2><b>This belongs to  {$item.user_name} </b></H2><br>
{/foreach}

<div>Links and or data</div>
 
{/literal}
{/capture}

{jrCore_list module="jrBlog" order_by="_created desc" limit="1" search1="profile_quota_id = ##" search2="blog_category = Category" template=$template}


Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.