A few remaining issues in member images galleries
Ning To Jamroom
The Great Good News! is that I was able to get the functionality to work the way I want it to. My challenge was that a link on the page with the name Images appeared on the page in two different places and had very different outcomes. Furthermore, two links with different names had the same outcome.
What I was looking to do was to display a Gallery View when the visitor to the page clicks on Gallery in the menu ribbon across the top of the profile. The URL for this is:
domainname.tld/membername/gallery
However, when the visitor to the page clicks on the Images button in the Stats section I wanted to display all of the images irrespective of any gallery associations (which is the way Images works in the top nav except it shows all images without member associations and grouping.
Here's the working code. It starts at line 89 in profile_sidebar.tpl and I have copied the entire {if isset ...} block even though I have only changed what's inside the {literal}. There was only one problem I had working from Michael's example, which is that he used an href when the onclick handler was needed. I quickly realized the problem and made the fix.
{if isset($_conf.nsTCLSkin1_profile_stats) && $_conf.nsTCLSkin1_profile_stats == 'on'}
<div class="block">
<h3>{jrCore_lang skin=$_conf.jrCore_active_skin id="39" default="stats"}</h3>
<div class="block_content mt10">
<div style="padding-top:8px">
{capture name="template" assign="stats_tpl"}
{literal}
{foreach $_stats as $title => $_stat}
{jrCore_module_url module=$_stat.module assign="murl"}
<div class="stat_entry_box"
{if $_stat.module == "jrGallery"}
onclick="window.location='{$jamroom_url}/{$profile_url}/gallery/{$profile_url}/all'"><span class="stat_entry_title">{$title}:</span> <span class="stat_entry_count">{$_stat.count|default:0}</span></a>
{else}
onclick="window.location='{$jamroom_url}/{$profile_url}/{$murl}'"><span class="stat_entry_title">{$title}:</span> <span class="stat_entry_count">{$_stat.count|default:0}</span></a>
{/if}
</div>
{/foreach}
{/literal}
{/capture}
{jrProfile_stats profile_id=$_profile_id template=$stats_tpl}
<div class="clear"></div>
</div>
</div>
</div>
{/if}
IMO, the URL on this is unnecessarily complicated and needs to be simplified.
The final path in the above is:
{$jamroom_url}/{$profile_url}/gallery/{$profile_url}/all
The question I have is why the extra {$profile_url}?
If the actual final path was:
{$jamroom_url}/{$profile_url}/gallery/all
This would do two things:
First is that it would eliminate the second membername from the path (and in the breadcrumb trail) which is totally confusing to me why it's even there - and if it's confusing to me it's going to be confusing to my members.
Second, from a coding perspective, is that it simplifies the code to:
{$jamroom_url}/{$profile_url}/{$murl}/all
Which has a LOT of advantages when it comes to maintenance across future upgrades.
updated by @claygordon: 01/14/15 11:39:15AM