Bienvenue, Invité
Nom d'utilisateur : Mot de passe :


For issues related to the current stable release please use it's own Help forum.
IMPORTANT:Please read this before using an git or nightly build version: wiki.webtrees.net/en/GIT

Before asking for help please read "How to request help" by clicking on that tab above here.

SUJET : [SOLVED] Hiding Theme Menu from Non-authenticated Visitors

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 22 heures #1

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Hi Everyone,

Hoping this is an easy one although I'll feel embarrassed for needing to ask if it is an easy one.

On WT 1.7.X, there was a toggle on the Site-preferences section of the control panel that disabled the Theme menu for non-authenticated visitors.



I cannot find such a toggle on WT 2.X. There is a toggle in the tree preferences for a given tree, but switching that to No doesn't have any impact. Non-authenticated visitors still get the theme menu.



Is this possible in WT 2.X? If so, where do I flip the switch?

Thanks,

Bill Anderson
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
Dernière édition: il y a 4 jours 22 heures par dbq-andersons. Raison: Typos galore...
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 21 heures #2

  • fisharebest
  • Portrait de fisharebest
  • en ligne
  • Administrator
  • Messages : 11223
Ah - that setting is obsolete, and needs to be removed.

To remove the menu, you need to disable all themes - except the one you want.

That same applies to langauges. If only one language is enabled, then the language menu is not shown.
Greg Roach - Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser. - fisharebest.webtrees.net
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 20 heures #3

  • bertkoor
  • Portrait de bertkoor
  • Hors Ligne
  • Gold
  • Greetings from Utrecht, Holland
  • Messages : 1619
Not to argue with the feature, but most (if not nearly all) people are lazy. I really wonder how many visitors, given the opportunity, have ever switched theme. And ofcourse there's another small group that tries out everything.

Has anybody got statistics from captured analytics?
stamboom.BertKoor.nl runs on webtrees v1.7.13
Dernière édition: il y a 4 jours 20 heures par bertkoor.
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 20 heures #4

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Hi Greg,

I gotcha. I found this line of code in app/Module/ModuleThemeTrait.php and removing all of the ones I didn't want was my next move anyway.

$current_theme = app(ModuleThemeInterface::class);

if ($themes->count() > 1) {
$submenus = $themes->map(static function (ModuleThemeInterface $theme) use ($current_theme): Menu {
$active = $theme->name() === $current_theme->name();
$class = 'menu-theme-' . $theme->name() . ($active ? ' active' : '');


Looks like I was heading down the right track.

Thanks as always!

Bill Anderson
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.

[SOLVED] Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 20 heures #5

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Problem solved.
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 16 heures #6

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Of course, I hit the Solved button a little too soon.

Is there a way to hide the Palette menu in the colors theme? Can't figure it out from the code in ./app/Module/ColorsTheme.php

Apparently, I don't want my visitors to have ANY control over how they see the site :-)

Thanks,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 8 heures #7

  • ddrury
  • Portrait de ddrury
  • Hors Ligne
  • Senior
  • Messages : 260
Don't edit code, do it from Control panel - modules - themes
--
Dave

Local: Win 10 Pro, Apache 2.4.17 virtual hosts, PHP 5.4.21, 5.5.15, 5.6.16 & 7.0.0, Mysql 5.7.9 all 64bit
Production: linux 2.6.32.21-grsec #5 SMP, Apache 2.2, PHP 5.6.15, Mysql 5.5.28-29.1
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 7 heures #8

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Not looking to edit the code. I'm not wise enough in the ways of PHP or CSS to do that. I'm a UNIX geek by trade; my web design knowledge peaked in the mid-90s with hand-written HTML tables and frames (ugh, I know) written with vi.

Just looking to figure out how the menu gets built and if there's a clue in the code as to how to shut it off. I have all other theme modules disabled except for the "Colors" one. The "Themes" menu has dropped away as advertised by Greg's note yesterday. Now I'm looking to disable the Palette menu as well. It's still there.



Thanks,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.
Avez-vous besoin d'une solution d'hébergement web pour votre site webtrees ?
Si vous préférez un hébergeur spécialisé de webtrees, la page suivante en liste quelques-uns capables de vous offrir ce type de service :

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 6 heures #9

  • ddrury
  • Portrait de ddrury
  • Hors Ligne
  • Senior
  • Messages : 260
Ah OK you want the colors theme but no palette menu unless logged in

Change line 59 ofapp\Module\ColorsTheme.php from
$this->menuPalette(),
to
Auth::check() ? $this->menuPalette() : null,
--
Dave

Local: Win 10 Pro, Apache 2.4.17 virtual hosts, PHP 5.4.21, 5.5.15, 5.6.16 & 7.0.0, Mysql 5.7.9 all 64bit
Production: linux 2.6.32.21-grsec #5 SMP, Apache 2.2, PHP 5.6.15, Mysql 5.5.28-29.1
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 4 jours 6 heures #10

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Bingo!



Thanks, Dave.

Cheers,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 3 jours 10 heures #11

  • Manja
  • Portrait de Manja
  • Hors Ligne
  • New
  • Messages : 91
dbq-andersons écrit:
Apparently, I don't want my visitors to have ANY control over how they see the site :-)

Just wondering: Why?
A different color scheme might be more eye-friendly to some users.
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 3 jours 6 heures #12

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
Hmmm...that is a good point. I hadn't thought about it that way.

I tend to be a control freak when it comes to how web pages look. However, I do see where you're coming from. Visitors might like a little choice.

Thanks,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 3 jours 6 heures #13

  • fisharebest
  • Portrait de fisharebest
  • en ligne
  • Administrator
  • Messages : 11223
In webtrees2, themes are now modules. This means that they can have configuration options.

So, the choice of colour-scheme and the display of the menu could easily be made configurable.

Create an issue on the github tracker...
Greg Roach - Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser. - fisharebest.webtrees.net
L'administrateur a désactivé l'accès en écriture pour le public.

Hiding Theme Menu from Non-authenticated Visitors il y a 3 jours 4 heures #14

  • dbq-andersons
  • Portrait de dbq-andersons
  • Hors Ligne
  • New
  • Messages : 51
#2543 has been opened.

Thanks Greg, as always.

Cheers,

Bill
Bill Anderson | Onalaska, WI | genealogy.dbq-andersons.com
Webtrees 2.0.0 beta 3 | Apache 2.4.29-1 | PHP 7.2.20-1 | MySQL 5.7.26
Ubuntu 18.04.2 LTS Running on a PC in My Basement
L'administrateur a désactivé l'accès en écriture pour le public.
Propulsé par Kunena