The function renders html ? If yes thus should be changed to let smarty render it. The function only generates the pages list
The function renders html ? If yes thus should be changed to let smarty render it. The function only generates the pages list
<!-- github-comment-id:182483380 -->
So even if we add a configuration setting, themes will have to implement it as well. So it's also a "theme issue". It's more complex than I thought (and the feature is not important).
Actually I'm half wrong. The rendering is done in Smarty:
$ find . -name navigation_bar.tpl
./stripped_black_bloc/template/navigation_bar.tpl
./simple/template/navigation_bar.tpl
./stripped/template/navigation_bar.tpl
./default/template/navigation_bar.tpl
./luciano/template/navigation_bar.tpl
./stripped_responsive/template/navigation_bar.tpl
./bootstrapdefault/template/navigation_bar.tpl
./smartpocket/template/navigation_bar.tpl
So even if we add a configuration setting, themes will have to implement it as well. So it's also a "theme issue". It's more complex than I thought (and the feature is not important).
<!-- github-comment-id:182485402 -->
The idea would be to simply add an "if" statement in the template, like:
{if $conf.paginate_show_first_last}{/if}
but it would only work on themes which implements it or themes that rely on the default navigation_bar.tpl
The idea would be to simply add an "if" statement in the template, like:
{if $conf.paginate_show_first_last}{/if}
but it would only work on themes which implements it or themes that rely on the default navigation_bar.tpl
<!-- github-comment-id:182487105 -->
@plegall But won't that function only be run if a theme calls it?
What is the problem with displaying it based only on if it is in the template or not?
@plegall But won't that function only be run if a theme calls it?
What is the problem with displaying it based only on if it is in the template or not?
<!-- github-comment-id:182495141 -->
Themes don't really call the function create_navigation_bar(). This function is called in index.php (for example) to generate the navigation bar for thumbnails. index.php adds it to the template variables. Then the template file navigation_bar.tpl looks for the appropriate template variable to build HTML code.
The idea is to have this feature "configurable" in Piwigo core. Then themes (thanks to template files) can implement it or not. A theme can perfectly decide to remove page numbers and only display prev/next as pagination bar. It doesn't mean all users of this theme will like it that way.
Themes don't really call the function create_navigation_bar(). This function is called in index.php (for example) to generate the navigation bar for thumbnails. index.php adds it to the template variables. Then the template file navigation_bar.tpl looks for the appropriate template variable to build HTML code.
The idea is to have this feature "configurable" in Piwigo core. Then themes (thanks to template files) can implement it or not. A theme can perfectly decide to remove page numbers and only display prev/next as pagination bar. It doesn't mean all users of this theme will like it that way.
<!-- github-comment-id:182502670 -->
hi guys
"The idea is to have this feature "configurable" in Piwigo core" again one config/var for such detail... I would rather prefer to see it as a pure theme config
what about something like
<div class="navigationBar">
{ if $navbar.pages|@count < 5}
{******** only displays number of pages if there is not so much pages *****************}
{foreach from=$navbar.pages key=page item=url}
{if $page == $navbar.CURRENT_PAGE}
<span class="current">{$page}</span>
{else}
<a href="{$url}">{$page}</a>
{/if}
{assign var='prev_page' value=$page}
{/foreach}
{else}
{********************* else display first/last and ... ***********************}
{if isset($navbar.URL_FIRST)}
<a href="{$navbar.URL_FIRST}" rel="first">{'First'|@translate}</a> |
<a href="{$navbar.URL_PREV}" rel="prev">{'Previous'|@translate}</a> |
{else}
{'First'|@translate} |
{'Previous'|@translate} |
{/if}
{assign var='prev_page' value=0}
{foreach from=$navbar.pages key=page item=url}
{if $page > $prev_page+1}...{/if}
{if $page == $navbar.CURRENT_PAGE}
<span class="pageNumberSelected">{$page}</span>
{else}
<a href="{$url}">{$page}</a>
{/if}
{assign var='prev_page' value=$page}
{/foreach}
{if isset($navbar.URL_NEXT)}
| <a href="{$navbar.URL_NEXT}" rel="next">{'Next'|@translate}</a>
| <a href="{$navbar.URL_LAST}" rel="last">{'Last'|@translate}</a>
{else}
| {'Next'|@translate}
| {'Last'|@translate}
{/if}
</div>
hi guys
"The idea is to have this feature "configurable" in Piwigo core" again one config/var for such detail... I would rather prefer to see it as a pure theme config
what about something like
```
<div class="navigationBar">
{ if $navbar.pages|@count < 5}
{******** only displays number of pages if there is not so much pages *****************}
{foreach from=$navbar.pages key=page item=url}
{if $page == $navbar.CURRENT_PAGE}
<span class="current">{$page}</span>
{else}
<a href="{$url}">{$page}</a>
{/if}
{assign var='prev_page' value=$page}
{/foreach}
{else}
{********************* else display first/last and ... ***********************}
{if isset($navbar.URL_FIRST)}
<a href="{$navbar.URL_FIRST}" rel="first">{'First'|@translate}</a> |
<a href="{$navbar.URL_PREV}" rel="prev">{'Previous'|@translate}</a> |
{else}
{'First'|@translate} |
{'Previous'|@translate} |
{/if}
{assign var='prev_page' value=0}
{foreach from=$navbar.pages key=page item=url}
{if $page > $prev_page+1}...{/if}
{if $page == $navbar.CURRENT_PAGE}
<span class="pageNumberSelected">{$page}</span>
{else}
<a href="{$url}">{$page}</a>
{/if}
{assign var='prev_page' value=$page}
{/foreach}
{if isset($navbar.URL_NEXT)}
| <a href="{$navbar.URL_NEXT}" rel="next">{'Next'|@translate}</a>
| <a href="{$navbar.URL_LAST}" rel="last">{'Last'|@translate}</a>
{else}
| {'Next'|@translate}
| {'Last'|@translate}
{/if}
</div>
```
<!-- github-comment-id:182582111 -->
Your idea to show only page numbers when there is less than 5 pages is nice (it could be nice for default navigation_bar.tpl)
I would rather prefer to see it as a pure theme config
So it would mean you have to change theme to get the navigation bar you want?
Another solution could be to just have specific CSS class on navigation bar links. Making it easy to hide with a CSS rule.
Another solution could be to have a plugin to replace navigation_bar.tpl, with an admin page for options and so on.
Actually I wanted this to be super easy so that I can implement it in Piwigo 2.8. Obviously it's not that "easy" ;-) I'm simply going to add CSS class on first/last links on default navigation_bar.tpl.
Your idea to show only page numbers when there is less than 5 pages is nice (it could be nice for default navigation_bar.tpl)
> I would rather prefer to see it as a pure theme config
So it would mean you have to change theme to get the navigation bar you want?
Another solution could be to just have specific CSS class on navigation bar links. Making it easy to hide with a CSS rule.
Another solution could be to have a plugin to replace navigation_bar.tpl, with an admin page for options and so on.
Actually I wanted this to be super easy so that I can implement it in Piwigo 2.8. Obviously it's not that "easy" ;-) I'm simply going to add CSS class on first/last links on default navigation_bar.tpl.
<!-- github-comment-id:182775534 -->
that's not that "easy" because it's asking a again the question of where we do what (I could argue again about template extensions :) :) which could do that if they were handled like plugins; no options page just switching on/off the TE )
So it would mean you have to change theme to get the navigation bar you want?
It depends on how well themes are updated. If we think theoretically/ideologically that would to the themes to manage that, but from a pragmatic point of view, a plugin would do the job better since the navigation bar is almost the same everywhere and theme developers wouldn't have to do the efforts
that's not that "easy" because it's asking a again the question of where we do what (I could argue again about template extensions :) :) which could do that if they were handled like plugins; no options page just switching on/off the TE )
> So it would mean you have to change theme to get the navigation bar you want?
It depends on how well themes are updated. If we think theoretically/ideologically that would to the themes to manage that, but from a pragmatic point of view, a plugin would do the job better since the navigation bar is almost the same everywhere and theme developers wouldn't have to do the efforts
<!-- github-comment-id:182879832 -->
I don't want to restart a discussion about template-extension. They are too complicated. Plugins can do the same job and avoid failure after upgrade.
I will implement the request "the easy way" for 2.8 but if someone wants to propose a "smart navigation bar" as plugin, it would make some users happy :-) Again, I think it's really a minor feature.
I don't want to restart a discussion about template-extension. They are too complicated. Plugins can do the same job and avoid failure after upgrade.
I will implement the request "the easy way" for 2.8 but if someone wants to propose a "smart navigation bar" as plugin, it would make some users happy :-) Again, I think it's really a minor feature.
<!-- github-comment-id:182884146 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Sometimes it's useless and we don't want to have such a "full featured" pagination bar.
Isn't this more of a thing that themes/templates can handle?
@eberkund no it's not because pagination bar is generated in include/functions.inc.php create_navigation_bar()
The function renders html ? If yes thus should be changed to let smarty render it. The function only generates the pages list
Actually I'm half wrong. The rendering is done in Smarty:
$ find . -name navigation_bar.tpl
./stripped_black_bloc/template/navigation_bar.tpl
./simple/template/navigation_bar.tpl
./stripped/template/navigation_bar.tpl
./default/template/navigation_bar.tpl
./luciano/template/navigation_bar.tpl
./stripped_responsive/template/navigation_bar.tpl
./bootstrapdefault/template/navigation_bar.tpl
./smartpocket/template/navigation_bar.tpl
So even if we add a configuration setting, themes will have to implement it as well. So it's also a "theme issue". It's more complex than I thought (and the feature is not important).
The idea would be to simply add an "if" statement in the template, like:
{if $conf.paginate_show_first_last}{/if}
but it would only work on themes which implements it or themes that rely on the default navigation_bar.tpl
@plegall But won't that function only be run if a theme calls it?
What is the problem with displaying it based only on if it is in the template or not?
Themes don't really call the function create_navigation_bar(). This function is called in index.php (for example) to generate the navigation bar for thumbnails. index.php adds it to the template variables. Then the template file navigation_bar.tpl looks for the appropriate template variable to build HTML code.
The idea is to have this feature "configurable" in Piwigo core. Then themes (thanks to template files) can implement it or not. A theme can perfectly decide to remove page numbers and only display prev/next as pagination bar. It doesn't mean all users of this theme will like it that way.
hi guys
"The idea is to have this feature "configurable" in Piwigo core" again one config/var for such detail... I would rather prefer to see it as a pure theme config
what about something like
Your idea to show only page numbers when there is less than 5 pages is nice (it could be nice for default navigation_bar.tpl)
So it would mean you have to change theme to get the navigation bar you want?
Another solution could be to just have specific CSS class on navigation bar links. Making it easy to hide with a CSS rule.
Another solution could be to have a plugin to replace navigation_bar.tpl, with an admin page for options and so on.
Actually I wanted this to be super easy so that I can implement it in Piwigo 2.8. Obviously it's not that "easy" ;-) I'm simply going to add CSS class on first/last links on default navigation_bar.tpl.
that's not that "easy" because it's asking a again the question of where we do what (I could argue again about template extensions :) :) which could do that if they were handled like plugins; no options page just switching on/off the TE )
It depends on how well themes are updated. If we think theoretically/ideologically that would to the themes to manage that, but from a pragmatic point of view, a plugin would do the job better since the navigation bar is almost the same everywhere and theme developers wouldn't have to do the efforts
I don't want to restart a discussion about template-extension. They are too complicated. Plugins can do the same job and avoid failure after upgrade.
I will implement the request "the easy way" for 2.8 but if someone wants to propose a "smart navigation bar" as plugin, it would make some users happy :-) Again, I think it's really a minor feature.