good afternoon all,
What is the best way how to rename "Home"?
screenshot:
I am sure that it doesn't take too long to find where this word is hidden and to change it - but it will probably change back right after the next update.
Thank you in advance,
Helmuts
Piwigo version: 2.8.1
PHP version: 5.5.33
MySQL version: 5.6.30
Piwigo URL: http://www.artforweb.co.uk
Offline
That is a language dependent replacement string {'Home'|@translate} which is used in two places in the template
a) themes/bootstrap_darkroom/template/index.tpl -> the <nav> section after the jquery voodoo
b) themes/bootstrap_darkroom/template/picture_nav.tpl -> dito
And for subcategories like http://www.artforweb.co.uk/index/category/68-spiders there is some jQuery voodoo in place that trims all but the last two levels, and prepends it with a home icon.
So I guess the easiest way to persist this is to (mis-)use the PersoFooter plugin, adding something like
<script type="text/javascript"> $(document).ready(function() { $('.navbar-secondary').find('a[href="/"]').text('My own text that will not get translated'); }); </script>
Or use .html('<i class="fa fa-home"></i>') if you prefer an icon (both fontawesome and bootstrap's glyphicons are available in the theme).
Not ideal because the <script> is somewhere inside the footer's <span> tags, but it does work.
BTW a very cool use for the jumbotron header on your site! (and the affix for the lower navbar still works, woohoo)
Last edited by teekay (2016-06-06 17:50:50)
Offline
Use Localfiles Editor to change the language srting in your language
Offline
As said by flop25, activate plugin LocalFiles Editor then page [Administration > Plugins > LocalFiles Editor > tab "Languages"], select your language and use this code:
<?php $lang['Home'] = "House"; ?>
Offline
To change the text for just one or several languages, this is infact the best solution.
I was assuming that the text should be changed globally, replaced with an icon, or totally hidden.
jQuery is the best solution for that case. But instead of misung the PersoFooter plugin like I suggested above, one should use the Add <head> element plugin, it fits the purpose way better.
Two more examples:
a) always use the icon for the home link
<script type="text/javascript"> $(document).ready(function() { var elm = $('.navbar-secondary .navbar-brand'); elm.find('a[href="/"]').html('<span class="glyphicon glyphicon-home"></span>'); }); </script>
(replace href="/" with your piwigo root, if needed (e.g. href="/piwigo")
b) hide it completely if current page is the homepage
<script type="text/javascript"> $(document).ready(function() { var elm = $('.navbar-secondary .navbar-brand'); if (elm.find('a').length === 1) { elm.hide(); } }); </script>
Last edited by teekay (2016-06-07 11:35:22)
Offline
plg wrote:
As said by flop25, activate plugin LocalFiles Editor then page [Administration > Plugins > LocalFiles Editor > tab "Languages"], select your language and use this code:
Code:
<?php $lang['Home'] = "House"; ?>
thank you guys and thank you @teekay as well for your suggestions.
All sorted :) .. fantastic support!
---
if somebody is trying to do the same - don't miss the part that you have to update your "Languages" not "Local config", screenshot:
all the best to all,
Helmuts
Offline
thank you for this detailed answer
Offline