Page 1 of 1

Problem with Uploads module : Can't display multiple summary

Posted: Tue Oct 25, 2016 4:21 pm
by naturelab
Problem with Uploads module : Can't display multiple summaries on the same page.

This is what I am trying to acheive...
http://www.orchardlink.org.uk/dev/growi ... resources/

Code: Select all

<!-- Online toolkit resources -->
<section id="downloads1">
  <div class="parallax case1">
    <div class="container inner text-center">
      <h2><i class="icon-tools"></i> {$toolkitsectionheader1}</h2>
      {$toolkitsectionintro1}
        <div class="row grid-view">
          {cms_module module="Uploads" category="Digital Media" mode="summary" sortorder="name_asc" }
        </div><!--/.row -->
    </div><!--/.conatiner -->
</section>

<section id="downloads2">
  <div class="parallax case2">
    <div class="container inner text-center">
      <h2><i class="icon-tools"></i> {$toolkitsectionheader2}</h2>
      {$toolkitsectionintro2}
        <div class="row grid-view">
          {cms_module module="Uploads" category="Community Orchard Toolkit - Group Development" mode="summary" sortorder="name_asc" }
        </div><!--/.row -->
    </div><!--/.conatiner -->
  </div> <!-- /.parallax -->
</section>

<section id="downloads3">
  <div class="parallax case3">
    <div class="container inner text-center">
      <h2><i class="icon-tools"></i> {$toolkitsectionheader3}</h2>
      {$toolkitsectionintro3}
        <div class="row grid-view">
          {cms_module module="Uploads" category="Community Orchard Toolkit - Orchard Site Development" mode="summary" sortorder="name_asc" }
        </div><!--/.row -->
    </div><!--/.conatiner -->
  </div> <!-- /.parallax -->
</section>

<section id="downloads4">
  <div class="parallax case4">
    <div class="container inner text-center">
      <h2><i class="icon-tools"></i> {$toolkitsectionheader4}</h2>
      {$toolkitsectionintro4}
        <div class="row grid-view">
          {cms_module module="Uploads" category="Community Orchard Toolkit - Resources" mode="summary" sortorder="name_asc" }
        </div><!--/.row -->
    </div><!--/.conatiner -->
  </div> <!-- /.parallax -->
</section>


Unfortunately the Category ( category="" ) is being ignored. If I remove the last three sections and just display ONE summary, it behaves and works as expected.

The issue is definitel about multiple siummary display

Any ideas ?
  • ----------------------------------------------

    Cms Version: 2.1.5

    Installed Modules:

    AdminSearch: 1.0.2
    CGBlog: 1.14.1
    CGContentUtils: 2.1.5
    CGExtensions: 1.53.13
    CGGoogleMaps2: 1.1.1
    CGSimpleSmarty: 2.1.4
    CGSnapshot: 1.0
    CGStaticMaps: 1.0.0
    CMSContentManager: 1.1.1
    CMSMailer: 6.2.14
    DesignManager: 1.1.1
    FileManager: 1.5.2
    FormBuilder: 0.8.1.4
    Gallery: 2.1.6
    JQueryTools: 1.3.9
    MicroTiny: 2.0.3
    ModuleManager: 2.0.4
    Navigator: 1.0.3
    News: 2.50.5
    Search: 1.50.2
    SimpleSiteInfo: 3.1.1
    Uploads: 1.24

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 4:24 pm
by naturelab
So, each <section> should display a different selection of pdfs to download. What is happening, is that the category is being ignored and the same selection is being shown ( basically the selection is ALL the documents in ALL the categories specified on the page )

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 6:57 pm
by Rolf
I tested this:

Code: Select all

{Uploads category='Boermarke'}
{Uploads category='Bollenveen'}
And it works as you can see http://beeldbank.zeijen.nu/test
But I did put the tags in the page content and not in the page template...

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 8:09 pm
by naturelab
Thanks Rolf, Could you try it specifically with a summary template ?

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 9:30 pm
by naturelab
Still not working for me. I have removed the MODE part and inserted the tags into the pagecontent also.

Code: Select all

{cms_module module="Uploads" category="Digital Media" } {cms_module module="Uploads" category="Community Orchard Toolkit - Group Development" } {cms_module module="Uploads" category="Community Orchard Toolkit - Orchard Site Development" } {cms_module module="Uploads" category="Community Orchard Toolkit - Resources" }
Maybe it is the chjoice of category names that I have used ?
I notice you have used one word and I have a mixture of words / spaces etc

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 10:24 pm
by paulbaker
naturelab wrote:Maybe it is the chjoice of category names that I have used ?
I notice you have used one word and I have a mixture of words / spaces etc
I have a vague recollection of having issues with long category names in a related module - certainly worth a try with short names.

Re: Problem with Uploads module : Can't display multiple sum

Posted: Tue Oct 25, 2016 10:47 pm
by naturelab
Screen Shot 2016-10-25 at 23.45.37.png
mmm. Renamed all the categories to eliminate spaces etc... Still no joy

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Oct 26, 2016 3:23 pm
by velden
Dit my best to kill the module but failed:

Code: Select all

Cat 1:<br>
{cms_module module="Uploads" category="Cat 1" mode="summary" sortorder="name_asc" }
Cat 2:<br>
{cms_module module="Uploads" category="Cat 2" mode="summary" sortorder="name_asc" }
Cat Community Orchard Toolkit - Group Development:<br>
{cms_module module="Uploads" category="Community Orchard Toolkit - Group Development" mode="summary" sortorder="name_asc" }
All seems to work in my setup.

So seems your category parameter gets completely ignored. Try to type one of those {cms_content ... } tags again by hand (to eliminate a copy/paste error, e.g. a strange character).

If that doesn't help I would start to debug the module itself. Though it requires some knowledge of CMSMS modules and php.
Make sure to have a backup of files and DB.

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Oct 26, 2016 3:25 pm
by naturelab
Thanks for trying !

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Nov 02, 2016 5:08 pm
by naturelab
Looking at this again, I have discovered that it works fine with default sumary template, so the problem is with my template ( apologies to all ).

Can anyone point out what is happening in this template, to cause the page template ignore the categories ?

Code: Select all

<!-- Start Upload Summary Template -->
<div id="container" class="ol-pdf">

{if isset($items)}
  {foreach from=$items item='entry' name='uploads'}

							 <div class="col-xs-6 col-md-3 pdfs" {if isset($entry->fields)}
                   {foreach name=fields from=$entry->fields key='fldname' item='field'}data-sort="{$field.value}"{/foreach}
                 {/if}>
							    <div class="post documentdownload">
<i class="fa fa-file-text-o fa-3x" aria-hidden="true"></i>
									    <div class="box">
										  {if isset($entry->summary)}<h6>{$entry->summary}</h6>{/if}<br/>

                      {if isset($entry->fields)}
                          {foreach name=fields from=$entry->fields key='fldname' item='field'}<h6 class="year">{$field.value}</h6>{/foreach}
                        {/if}


                      {if isset($entry->detailurl)}
                      <p><i class="fa fa-file-pdf-o" aria-hidden="true"></i> <a href="{$entry->download_url}" title="Download {$entry->summary}">Download PDF</a></p>
                      {else}
                      <span>{$entry->upload_name}&nbsp;({$entry->size})
                      {/if}
									    </div><!-- /.box -->
								    </div><!-- /.post -->
							    </div><!-- /column -->

{/foreach}
{/if}
</div>
<!-- End Upload Summary Template -->

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Nov 02, 2016 5:19 pm
by paulbaker
This missing > maybe?

<div class="col-xs-6 col-md-3 pdfs"> {if isset($entry->fields)}

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Nov 02, 2016 5:29 pm
by naturelab
Thanks for looking Paul, but that does actually get get closed here:-

<div class="col-xs-6 col-md-3 pdfs" {if isset($entry->fields)}
{foreach name=fields from=$entry->fields key='fldname' item='field'}data-sort="{$field.value}"{/foreach}{/if}>

Re: Problem with Uploads module : Can't display multiple sum

Posted: Wed Nov 02, 2016 6:57 pm
by paulbaker
My bad, sorry. :(

You are missing a closing span here

Code: Select all

<span>{$entry->upload_name}&nbsp;({$entry->size})
but that won't cause your symptoms.

My only guess is that it is scope related. You are calling the same code several times, and Smarty is using the initial data rather than the different categories called. If that's right, you will need someone cleverer than me to come along and explain it fully. ;D

Re: Problem with Uploads module : Can't display multiple sum

Posted: Thu Nov 03, 2016 7:10 pm
by naturelab
OK - Fixed this now. Working template below if it helps anyone else.
Thanks for your time people :)

Code: Select all

<!-- Start Upload Summary Template -->

{if isset($items)}
  {foreach from=$items item='entry' name='uploads'}
    {if ($smarty.foreach.uploads.index == 0) }
      {if $smarty.foreach.uploads.iteration > 1}
        </div>
      {/if}
      <div id="container" class="row ol-pdf">
    {/if}



    <div class="upload col-xs-6 col-md-3 pdfs" {if isset($entry->fields)}
        {foreach name=fields from=$entry->fields key='fldname' item='field'}data-sort="{$field.value}"{/foreach}
      {/if}>
      <div class="post documentdownload">
          <div class="box">
          <!-- Title -->
          {if isset($entry->summary)}<h6>{$entry->summary}</h6>{/if}<br/>
          <!-- Custom Field Year -->
          {if isset($entry->fields)}
              {foreach name=fields from=$entry->fields key='fldname' item='field'}<h6 class="year">{$field.value}</h6>{/foreach}
            {/if}

    <!-- Download Lnk -->
      {if isset($entry->detailurl)}
    <p><a href="{$entry->download_url}" title="Download {$entry->summary}">Download PDF</a></p>
      {/if}

   <!-- File icon -->
      {if isset($entry->download_url)}
        <a href="{$entry->download_url}" title="{$entry->upload_name}">
          <img src="{$entry->iconurl}" alt="">
        </a>
      {/if}




    </div><!-- /.box -->
  </div><!-- /.post -->
    </div>


    {if $smarty.foreach.uploads.last}
      </div>
    {/if}
  {/foreach}
{/if}

<!-- End Upload Summary Template -->