Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2019-02-17 04:55:08

charking
Member
From: Montreal, Quebec, Canada
Registered: 2013-04-03
Posts: 142
Website

Hamburger Menu Items

When I view my web site on my cell phone or tablet, also when I horizontally compress the web browser window on my desktop, the hamburger menu appears in the upper left hand corner of the screen to provide the navigation menu items. In my case these appear in a small blue type font. As I recall with Backlight 1 these menu items appeared in a larger black font. I am using Adobe fonts, but I don't think this is affecting the hamburger menu items. Is there a way I can change this small blue font and; if so, where would the code be so that I can write the necessary overriding custom code?

My web site: http://charleskinghorn.com

Last edited by charking (2019-02-17 04:57:07)

Offline

#2 2019-02-17 05:12:14

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

Navigation > Vertical Navigation > Menu Items : Color

Or were you referring to the hamburger icon color?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2019-02-17 05:32:03

charking
Member
From: Montreal, Quebec, Canada
Registered: 2013-04-03
Posts: 142
Website

Re: Hamburger Menu Items

rod barbee wrote:

Navigation > Vertical Navigation > Menu Items : Color

Or were you referring to the hamburger icon color?

Thanks again, Rod. Once again, something simple set a couple of months ago and then forgotten. I expected special coding. I even kept my Adobe fonts.

The hamburger icon is blue right now and matches the social website icons in colour and sizing. Just for interest's sake, how can it be changed?

Offline

#4 2019-02-17 06:10:39

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

Top Pallet Settings.
Pallet Toggle for the hamburger and Buttons (I believe) for social media.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2019-08-31 22:57:37

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

Related question: is it possible to change the hamburger button to the word "menu"?

Offline

#6 2019-08-31 23:18:24

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

I’ve done it in Backlight 1 (Pangolin) so this should work:
https://ttg-tips-and-tricks.barbeephoto … menu-icon/

Phplugins code will need updating to the Backlight 2 format, as noted at the end of the post


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2019-12-01 03:07:10

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

I have tried the code suggested in https://ttg-tips-and-tricks.barbeephoto … menu-icon/ but still no "Menu".

Where is the mistake?

/* hamburger replaced by menu */
.page__toggle__buttons label p {
    cursor: pointer;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    min-width: 48px;
    height: 48px;
}

for the CSS and for the php:

<!-- Replace the mobile menu icon with the word "Menu"-->
function scripts($style, $path) {
<script>$(".page__toggle__buttons label ul").replaceWith("<p>Menu</p>");</script>

pideja.ca

Offline

#8 2019-12-01 03:21:25

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

As noted in that post, that code is for Backlight 1.
(EDIT: the end of the post addresses Backlight 2)

You can try modifying the phplugins so that it’s compatible with the Backlight 2 version, but I haven’t looked at the html structure to see if the css will even work.

(Remember, function ($style, $path) is not used in Backlight 2)


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#9 2019-12-01 04:24:05

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

My php is now:

<?php

function user_load($style, $path) {
  $g_tsvrl = explode(' ', $style); // Extract gallery type
  define ('G_STYLE', strtoupper($g_tsvrl[1])); // and set global for later
  $g_path = str_ireplace('\\','/',$path); // change \ to /
  $chunks = explode('/',$g_path); // and put into array
  define ('G_PATH', strtoupper($chunks[count($chunks)-2])); // gallery folder name is second to last
  //define ( 'TTG_SITE', ''); // set new site root for navigation, resources, etc.
}

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}

class PHPlugins extends APHPlugins
{

/* Replace the mobile menu icon with the word "Menu"*/
function scripts() {
<script>$(".page__toggle__buttons label ul").replaceWith("<p>Menu</p>");</script>

/* Display the logo in pallet_top */

function pallet_top_title () { 
  echo '

  <li class="top-pallet-logo"><a href="/"></a></li>

  ';
  return false;
} 
} ?>

While the CSS is still the same.

Still, no "Menu" replacing the hamburger.

By the way, where could I check to see if it will work, relative to the HTML structure?

Last edited by pideja (2019-12-01 04:28:25)

Offline

#10 2019-12-01 08:59:37

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

Actually, I should have written that I hadn’t looked at the html structure as it pertains to the jQuery.
The jQuery looks for an existing html element and replaces the existing content with something else.
Since Backlight 2 is structurally different in some places, the selector in that jQuery may not be appropriate. That’s probably why it’s not working.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2019-12-01 22:31:48

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

Just noticed that you didn’t properly close the function scripts () { section


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#12 2019-12-05 08:50:27

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

just took a look at the post again. The code in the post does work in BL 2. You just need to format the phplugins function correctly.
Unfortunately, it eliminates the X to close the mobile menu. Clearly, more work needs to be done on it.

And you'll need to style the new Menu button


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#13 2019-12-05 23:10:58

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

I think I correctly closed that PHP function...

<?php

function user_load($style, $path) {
  $g_tsvrl = explode(' ', $style); // Extract gallery type
  define ('G_STYLE', strtoupper($g_tsvrl[1])); // and set global for later
  $g_path = str_ireplace('\\','/',$path); // change \ to /
  $chunks = explode('/',$g_path); // and put into array
  define ('G_PATH', strtoupper($chunks[count($chunks)-2])); // gallery folder name is second to last
  //define ( 'TTG_SITE', ''); // set new site root for navigation, resources, etc.
}

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}

class PHPlugins extends APHPlugins
{

/* Replace the mobile menu icon with the word "Menu"*/

function scripts  () {
<script>$(".page__toggle__buttons label ul").replaceWith("<p>Menu</p>");</script>
}

/* Display the logo in pallet_top */

function pallet_top_title () { 
  echo '

  <li class="top-pallet-logo"><a href="/"></a></li>

  ';
  return false;
} 
} ?>

Still, no "MENU" in lieu of the hamburger.

While we are at it, that top pallet logo needs a reference (href) that would lead to where I put my top pallet image, right?

Offline

#14 2019-12-05 23:25:01

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

While we are at it, that top pallet logo needs a reference (href) that would lead to where I put my top pallet image, right?

Yes. That's done in the css
https://backlight-2-100.barbeephoto.com … ackground/


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#15 2019-12-05 23:31:42

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

Still, no "MENU" in lieu of the hamburger.

you forgot to use echo in the scripts hook

I also don't see the pallet_top_title html code being inserted

Make sure that you've chosen the correct phplugins file in the Page Template > Advanced Settings


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#16 2019-12-05 23:41:55

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

My bad: I forgot to enable the php plugin but when I did, I got this message:

Something went wrong
Unexpected error: syntax error, unexpected '<' in pangolin-pideja.php on line 22

Please report error at http://community.theturninggate.net

Offline

#17 2019-12-05 23:45:26

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

you forgot to use echo in the scripts hook


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#18 2019-12-05 23:46:54

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

it should look like this:

function scripts () {
echo'
<script>$(".page__toggle__buttons label ul").replaceWith("<p>Menu</p>");</script>
';
}

Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#19 2019-12-05 23:54:09

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

Great, thanks. All the menu needs now is a bit of styling in CSS.

As to the top pallet banner, as you have seen, I indicated a path to an image residing in the img folder. However, now that the php is in function, the title has been correctly replaced by an image, but it's not the one I indicated.
I'll have to look into the already uploaded images in Backlight and correct that path.

Offline

#20 2019-12-06 00:30:38

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

Having a hard time styling that word "MENU"...

Offline

#21 2019-12-06 00:47:48

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

you've already got css to target the p element, just mess around with that


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#22 2019-12-06 01:12:11

pideja
Member
From: Montreal
Registered: 2013-02-26
Posts: 1,299

Re: Hamburger Menu Items

With your help pointing out where to interact with the CSS, I finally set it up the way I want it:

.page__toggle__buttons label p {
    cursor: pointer;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    line-height: 2.5em;
    min-width: 48px;
    height: 48px;
}

Thanks again...

P.S. I will live with this layout for a while. I need to populate the web site a bit more. If and when I need more help with the top pallet, I'll start a new topic.

Last edited by pideja (2019-12-06 01:24:12)

Offline

#23 2019-12-06 11:42:36

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Hamburger Menu Items

Guys, hamburgers are gross and unsustainable. Backlight is environmentally neutral; it's a Pancake menu.


Matt

The Turning Gate, http://theturninggate.net

Offline

#24 2019-12-06 12:32:04

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Hamburger Menu Items

smile


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB