Announcement

#1 2016-06-06 16:39:32

helmuc
Member
Maidstone, UK
2013-05-23
73

[resolved] What is the best way to rename Home?

good afternoon all,

What is the best way how to rename "Home"?

screenshot: http://content.screencast.com/users/helmuc/folders/Jing/media/a2821238-6dff-48f7-a149-b9ad0ff3827b/renaming-home.png

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

 

#2 2016-06-06 17:49:43

teekay
Member
2013-06-12
427

Re: [resolved] What is the best way to rename Home?

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

Code:

<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

 

#3 2016-06-06 18:30:41

helmuc
Member
Maidstone, UK
2013-05-23
73

Re: [resolved] What is the best way to rename Home?

@teekay thank you

Offline

 

#4 2016-06-06 22:26:35

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] What is the best way to rename Home?

Use Localfiles Editor to change the language srting in your language


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2016-06-07 10:53:14

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [resolved] What is the best way to rename Home?

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";
?>

Offline

 

#6 2016-06-07 11:26:38

teekay
Member
2013-06-12
427

Re: [resolved] What is the best way to rename Home?

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

Code:

<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

Code:

<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

 

#7 2016-06-07 12:56:59

helmuc
Member
Maidstone, UK
2013-05-23
73

Re: [resolved] What is the best way to rename Home?

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:

http://content.screencast.com/users/helmuc/folders/Jing/media/4e494b43-a3e6-4428-8259-c92c54874d12/2016-06-07_1152.png

all the best to all,
Helmuts

Offline

 

#8 2016-06-07 22:53:34

PierreMR
Member
Lyon
2016-06-07
11

Re: [resolved] What is the best way to rename Home?

thank you for this detailed answer

Offline

 

Board footer

Powered by FluxBB

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