This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Pages: 1 - Last Post: 04-Apr-2019 19:10 Last Post By: hspagnolo Threads: [ Previous | Next ]
hspagnolo

Posts: 126
Registered: 23-Mar-2016
Page-header.inc
Posted: 03-Apr-2019 14:34
 
  Click to reply to this thread Reply
Hi Laza,

I have been able to modify the "page-header.inc" in order to add the home icon into the top nav by modifying the following code (I am aware that I will have to change this at with every Photoblogger update):

			/*
			 *	Top navigation
			 */
			 
			if (topNavigation && topNavigationPlacement.startsWith('header')) {
				out.println('\t\t\t<div id="topnav" class="row">' +
					'<div class="columns text-' + topNavigationPlacement.substring(6).toLowerCase() + '">' +
						'<div class="top-nav">' + topNavigation + '</div>' +
						'<a href="javascript:void(0)" class="icon-menu hide"></a>' +
					'</div>' +
				'</div>');
			}


by this code:

			/*
			 *	Top navigation
			 */
			 
			if (topNavigation && topNavigationPlacement.startsWith('header')) {
				out.println('\t\t\t<div id="topnav" class="row">' +
					'<div class="columns text-' + topNavigationPlacement.substring(6).toLowerCase() + '">' +
						'<a href="' + rootPath + '/' + indexName + '" class="icon-home" data-tooltip title="' + getText('home') + '"></a>  ' +
						'<div class="top-nav">' + topNavigation + '</div>' +					
						'<a href="javascript:void(0)" class="icon-menu hide"></a>' +
					'</div>' +
				'</div>');
			
			}


Now I try to avoid to display this icon on the root page with this code, but without success, what is wrong?

			/*
			 *	Top navigation
			 */
			 
			if (topNavigation && topNavigationPlacement.startsWith('header')) {
				out.println('\t\t\t<div id="topnav" class="row">' +
					'<div class="columns text-' + topNavigationPlacement.substring(6).toLowerCase() + '">' +
 
					if ((heroNavigation === 'uplink' || heroNavigation === 'both') && (typeof uplink !== 'undefined') && uplink) {
						'<a href="' + rootPath + '/' + indexName + '" class="icon-home" data-tooltip title="' + getText('home') + '"></a>  ' +
						'<div class="top-nav">' + topNavigation + '</div>' +
					} else {
					
					'<div class="top-nav">' + topNavigation + '</div>' +
 
					}
						'<a href="javascript:void(0)" class="icon-menu hide"></a>' +
					'</div>' +
				'</div>');
			
			}


Thanks and regards
Henri
Laza

Posts: 2,204
Registered: 6-Sep-2005
Re: Page-header.inc
Posted: 03-Apr-2019 17:44   in response to: hspagnolo in response to: hspagnolo
 
  Click to reply to this thread Reply
Can you please explain what's your goal? The home icon is already part of the top navigation.
hspagnolo

Posts: 126
Registered: 23-Mar-2016
Re: Page-header.inc
Posted: 03-Apr-2019 18:19   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Attachment screenshot_314.png (76.1 KB)
Hi Laza,

Not into my pages, see http://www.yetanotherhomepage.com/photoblogger.

I would like to have it (as option) as it was into v1, see snapshot coming from v1.9x.

I think it is more user-friendly to have it with the other items of the top menu, even if we can click on the logo top left.

Thanks and regards
Henri

Edited by: hspagnolo on 03-Apr-2019 18:20
Laza

Posts: 2,204
Registered: 6-Sep-2005
Re: Page-header.inc
Posted: 03-Apr-2019 19:10   in response to: hspagnolo in response to: hspagnolo
 
  Click to reply to this thread Reply
Ah, I see - when there's a logo the home icon is skipped. That code part came from Tiger, which always has the top menu next to the logo - so it would be a duplicate function there. In Photoblogger I see the point in having both when the menu is placed elsewhere. I will add this inclusion.
hspagnolo

Posts: 126
Registered: 23-Mar-2016
Re: Page-header.inc
Posted: 03-Apr-2019 19:13   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
As usual, thanks and thanks Laza
Laza

Posts: 2,204
Registered: 6-Sep-2005
Re: Page-header.inc
Posted: 04-Apr-2019 08:17   in response to: hspagnolo in response to: hspagnolo
 
  Click to reply to this thread Reply
Until the new version come out you can change this line of code in init.js (line 601):
vars.put('topNavigation', _useTopNavigation? getDropdownMenu(rootFolder, folder, !top && !logoName, topNavigationIncludeFolders, topNavigationIncludePages, topNavigationIncludeWebLocations, topNavigationDepth - 1) : '');

to this:
vars.put('topNavigation', _useTopNavigation? getDropdownMenu(rootFolder, folder, !top, topNavigationIncludeFolders, topNavigationIncludePages, topNavigationIncludeWebLocations, topNavigationDepth - 1) : '');

(Remove "&& !logoName")
Merlin2504

Posts: 366
Registered: 25-Jul-2016
Re: Page-header.inc
Posted: 04-Apr-2019 08:58   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Somehow I do not understand the Discussion here? For me the home button is present on all pages? Or do you mean something else?

https://duhlendorf.com/Bilder-65.Session/
Laza

Posts: 2,204
Registered: 6-Sep-2005
Re: Page-header.inc
Posted: 04-Apr-2019 10:01   in response to: Merlin2504 in response to: Merlin2504
 
  Click to reply to this thread Reply
When a logo is used previously it didn't generate the home link in the menu, only on the logo.
hspagnolo

Posts: 126
Registered: 23-Mar-2016
Re: Page-header.inc
Posted: 04-Apr-2019 18:39   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Thanks Laza, this is appreciated.

It works with pages containing folders, but it is not included into the pages like "About, Contact, Sitemap, etc...).

But I found why, the change you made has to be done also on line 365.

Regards
Henri

Edited by: hspagnolo on 04-Apr-2019 18:48

Edited by: hspagnolo on 04-Apr-2019 19:09
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums