Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Homebutton in php_retrieve_url_of_record

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Homebutton in php_retrieve_url_of_record

Unread post by getNo »

Hello,
i want to use the Code of yours, Kevin.

But there is no Home-Button.

My Landingpage is:
Startpage
Form ID: 602be8bdabda21b
Form Code: Startpage

Thanks for the good work and the fast replies so far.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Homebutton in php_retrieve_url_of_record

Unread post by kev1n »

Hi,

This function is already included in v4.5.

You can just call

Code: Select all

nuGetRecordURL()
The arguments are optional:

Code: Select all

function nuGetRecordURL($origin = '', $subFolder = '', $homepageId = '') 
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Re: Homebutton in php_retrieve_url_of_record

Unread post by getNo »

There is something wrong.

Code: Select all

nuDebug( nuGetRecordURL($origin='602e230f33e2162', $subFolder = '', $homepageId = 'Startpage'));

Code: Select all

[0] : 602e230f33e2162/index.php?f=xx&r=#RECORD_ID#&h=Startpage 

With the older code im getting a well formed url:
https://xxxxx.de/index.php?f=602e230f33 ... =Startpage

But ether with h=Formcode or h=Form ID i didnt get a Homebutton in the Navigationbar.
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Re: Homebutton in php_retrieve_url_of_record

Unread post by getNo »

Hello Kevin,
is there a way to get the homebutton working in the url?
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Homebutton in php_retrieve_url_of_record

Unread post by kev1n »

Pass the Form ID instead of the string "Startpage"
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Re: Homebutton in php_retrieve_url_of_record

Unread post by getNo »

ok, i did.

But there is still something wrong.

If im logged in new for the link i get a navigation but the "home-button" links to the same page.
2.png
If im already logged in, theres no navigation
1.png
But if i use a new blank "incognito-Tab" without any cookies i get this
3.png
The HOME-Link directs to the correct Startpage. Also some bugs in the displayed forms.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Homebutton in php_retrieve_url_of_record

Unread post by kev1n »

Try this:

Replace

Code: Select all

	if(window.nuLoginH != ''){

		$('#nuBreadcrumb0')
		.html(nuTranslate('Home'))
		.attr('onclick', '')
		.attr('onclick', 'nuForm("' + window.nuLoginH + '", -1, "", "", 1);');

		window.nuLoginH = ''

	}
with

Code: Select all

	if(window.nuLoginH != ''){
		
		var bc = $('#nuBreadcrumb0').length > 0 ? $('#nuBreadcrumb0') : $('#nuHomeGap');
		bc
		.html(nuTranslate('Home'))
		.attr('onclick', '')
		.attr('onclick', 'nuForm("' + window.nuLoginH + '", -1, "", "", 1);');

		window.nuLoginH = ''

	}

https://github.com/nuBuilder/nuBuilder- ... rm.js#L195
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Re: Homebutton in php_retrieve_url_of_record

Unread post by getNo »

Seems working. Thx for you help.
I used the code below, to get the familiar home button.

Code: Select all

	
if(window.nuLoginH != ''){
      
		var bc = $('#nuBreadcrumb0').length > 0 ? $('#nuBreadcrumb0') : $('#nuHomeGap');
		bc
		.html('<i class="fa fa-home" style="font-size:20px;padding:0px 5px 0px 0px"></i>')
		.attr('title', nuTranslate('Home'))
		.attr('onclick', '')
		.attr('onclick', 'nuForm("' + window.nuLoginH + '", -1, "", "", 1);');
  
		window.nuLoginH = ''
  
	 }
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Homebutton in php_retrieve_url_of_record

Unread post by kev1n »

Thanks, updated on Github.
Post Reply