Announcement

#16 2023-01-27 14:01:59

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

/themes/bootstrap_darkroom/template/index.tpl
-----------------------------------------------------------------
Line 12:

Code:

{if isset($chronology.TITLE)}
                <a href="{$U_HOME}" title="{'Home'|@translate}"><i class="fas fa-home" aria-hidden="true"></i></a>{$LEVEL_SEPARATOR}{$chronology.TITLE}
{else}
                <div class="nav-breadcrumb d-inline-flex">{$TITLE}{if $NB_ITEMS > 0}<span class="badge badge-secondary ml-2">{$NB_ITEMS}</span>{/if}</div>
{/if}

BTW Needs some css tweaking!

Best regards
Robert


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#17 2023-01-27 14:28:29

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

Direct link to the modified TPL file https://www.fotoarkiv.no/priv/index.tpl

Replace /themes/bootstrap_darkroom/template/index.tpl

NOW over to the RV Autocomplete search ISSUE! :-))


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#18 2023-01-27 14:39:58

matthys
Member
2014-04-02
188

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

Thanks Robert, much appreciated ;-)

Will have a look into it this weekend. Just to understand, what was the real problem?

Offline

 

#19 2023-01-27 15:12:44

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

Custom CSS to align the BADGE:

.ml-2, .mx-2 {
  margin-left: .5rem !important;
  height: min-content;
  margin-top: 5px;
}


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#20 2023-01-27 15:17:46

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

matthys wrote:

Thanks Robert, much appreciated ;-)

Will have a look into it this weekend. Just to understand, what was the real problem?

The suggested code was TOTALLY WRONG.

SUGGESTED CODE:

{if $cat.count_images > 0}
      <span class="{if $cat.nb_images > 0}menuInfoCat{else}menuInfoCatByChild{/if} badge" title="{$cat.TITLE}">{$cat.count_images}</span>
      {/if}

WORKING CODE:

{if isset($chronology.TITLE)}
                <a href="{$U_HOME}" title="{'Home'|@translate}"><i class="fas fa-home" aria-hidden="true"></i></a>{$LEVEL_SEPARATOR}{$chronology.TITLE}
{else}
                <div class="nav-breadcrumb d-inline-flex">{$TITLE}{if $NB_ITEMS > 0}<span class="badge badge-secondary ml-2">{$NB_ITEMS}</span>{/if}</div>
{/if}

Cheers
Robert


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#21 2023-01-28 10:59:13

matthys
Member
2014-04-02
188

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

Okay, so the main problem was not to use the $cat.count_images variable but $NB_ITEMS.

Just some feedback from me, I made copy of template and used the "Extend templates" under configuration (I belief you need to enable this to see).

Substitutes (customized templates) Original templates Optional URL keyword    Bound Theme
bootstrap_index.tpl                         index.tpl               ---------                     bootstrap_darkroom

Just to avoid if a new version of templates comes with bootstrap and overwrites my custom additions.
I also used a new class (album-photos-navbar), so I can easy just modify this particle part, and added the CSS in the LocalFiles Editor.

Code:

<div class="nav-breadcrumb d-inline-flex">{$TITLE}{if $NB_ITEMS > 0}<span class="album-photos-navbar">{$NB_ITEMS} photos</span>{/if}</div>

I'm still playing with the colours and size, but the result you can see here

Thanks,
Matthijs

Offline

 

#22 2023-01-28 14:45:09

BigIsland
Member
2015-02-12
3

Re: [resolved] How do I show the number of images in each album category Bootstrap DR

matthys wrote:

Okay, so the main problem was not to use the $cat.count_images variable but $NB_ITEMS.

Just some feedback from me, I made copy of template and used the "Extend templates" under configuration (I belief you need to enable this to see).

Substitutes (customized templates) Original templates Optional URL keyword    Bound Theme
bootstrap_index.tpl                         index.tpl               ---------                     bootstrap_darkroom

Just to avoid if a new version of templates comes with bootstrap and overwrites my custom additions.
I also used a new class (album-photos-navbar), so I can easy just modify this particle part, and added the CSS in the LocalFiles Editor.

Code:

<div class="nav-breadcrumb d-inline-flex">{$TITLE}{if $NB_ITEMS > 0}<span class="album-photos-navbar">{$NB_ITEMS} photos</span>{/if}</div>

I'm still playing with the colours and size, but the result you can see here

Thanks,
Matthijs

GOOD WORK !

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact