New responsive menu - logo link issue

Hi

So, the new(ish) responsive menu…

On it’s Layout tab (under Menu Items), you can provide a Logo and a compact logo. All good. However, when run that logo has a default hyperlink pointing to the menu app itself. In theory, that’s fine, after all, most web sites that have logos in the corner default to linking to the site’s home page.

However, clicking the logo just shows a white screen with “Invalid Data” displayed. Inspecting in the browser console the href for the “a” tag is “./”.

Question 1: Any ideas why it doesn’t like that link, especially as the link looks as if formed correctly? Note - it’s a logged-into project, so I’m wondering if it’s session related…

Question 2: In reality, I would actually like that link to point somewhere else (my business’s site). Any idea where I can change the default link?

TIA.

Adz

Hi Adz,
One possible way is to find out where is the link in the source.
I’ve spent some time - unfortunately I could not find it.

One negative effect is that if you click by error menu page is reloaded and all data (current cash) are lost.

It would be appreciated if SC developers ensure such an option - to change the link / off / on.

BR

Valeriy

1 Like

estoy en el mismo problema necesito colocar el logo y picture del usuario pero que sea variable y no logro conseguir que me muestre correctamente

1 Like

Hola, puedes utilizar variables globales para que sean dinámicas en onApplicationInit.
En el menú dentro de Items del menú + Layout en campo Logotipo escribe: [wlogo]
En el menú dentro de Items del menú + Menú del usuario en Imagen de usuario: [usr_picture], Nombre de usuario: [usr_name] y en Descripción: [usr_email]

Ejemplo: 
[wlogo]="scriptcase__NM__ct_pie_pie_2d.png";  //esta imagen está dentro de  _lib/img/
user_data();

//Metodo PHP user_data
[usr_picture] 	= '';
//[usr_login]='admin';
$check_sql = "SELECT name, email, picture FROM sec_users WHERE login='" . [usr_login]  ."'";
sc_lookup(rs, $check_sql);
//echo $check_sql;
if (isset({rs[0][0]}))     // Row found
{
    [usr_name] 		= {rs[0][0]};
    [usr_email] 	= {rs[0][1]};
    [usr_picture] 	= {rs[0][2]};
}
		else     // No row found
{
	[usr_name] 		= '';
	[usr_email] 	= '';
	[usr_picture] 	= '';		
}

if([usr_picture] != "")
{
	file_put_contents('../_lib/tmp/'. [usr_login], [usr_picture]);
	[usr_picture]= '../_lib/tmp/'. [usr_login];
}
2 Likes

gracias y alguna forma si la imagen esta en la base de datos ?

La última parte del código la baja al directorio temporal. Saludos.

1 Like

Hey @gbillot3 - thanks for your input above.

All makes sense (and I already do much of that using global vars). However, do you have any thoughts on how to override the generated “a” tag’s href to something of my choosing?

Thanks

Hi adz1111, I solved it by downloading/using the image from an archive. It was the only way I could find that worked.

image

Best regards.

1 Like

Hi @gbillot3

Hmmm - we might be talking about different things. I’m talking about the “main” logo, not the details associated with the logged-in user:

If I point the mouse over “./” , I can see the menu home url so If I clic the logo refresh the page.
Do you want this to redir to another url?

image

Hi @gbillot3

Exactly - if clicked it goes to …/scriptcase/app/RecruitDB/menu/ - that shows a white page:

…even though that is the project’s main URL (see previous image), so wondering why it’s “invalid data”. Regardless, what I really want is for it to go to a totally different site’s URL (and for it to open in a new tab).

?>	
<script type="text/javascript">
	window.onload = function () {
	var newURL = "https://youtube.com";
    document.getElementById("sc-menu-link-home").href = newURL;	
  };
</script>	
<?php

Use this code onApplicationInit

Hi @gbillot3

That works a treat! Thanks so much!

Not being a JS expert, any chance you can explain how I can tweak that so the target is “_blank”, i.e. opens in a new tab?

Thanks again.

Use this:

target="_blank"

add this line after document.get…

document.getElementById(“sc-menu-link-home”).target = “_blank”;

Perfect - thanks again!

Thanks GBILLOT,
It is good tip.