Homebutton in php_retrieve_url_of_record

Questions related to customising nuBuilder Forte with JavaScript or PHP.

Homebutton in php_retrieve_url_of_record

Unread postby getNo » Mon Mar 08, 2021 10:04 pm

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.
getNo
 
Posts: 20
Joined: Fri Feb 19, 2021 2:26 am

Re: Homebutton in php_retrieve_url_of_record

Unread postby kev1n » Mon Mar 08, 2021 10:59 pm

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 = '')
kev1n
nuBuilder Team
 
Posts: 2057
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Homebutton in php_retrieve_url_of_record

Unread postby getNo » Mon Mar 08, 2021 11:41 pm

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: 20
Joined: Fri Feb 19, 2021 2:26 am

Re: Homebutton in php_retrieve_url_of_record

Unread postby getNo » Wed Mar 10, 2021 5:17 pm

Hello Kevin,
is there a way to get the homebutton working in the url?
getNo
 
Posts: 20
Joined: Fri Feb 19, 2021 2:26 am

Re: Homebutton in php_retrieve_url_of_record

Unread postby kev1n » Thu Mar 11, 2021 9:39 pm

Pass the Form ID instead of the string "Startpage"
kev1n
nuBuilder Team
 
Posts: 2057
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Homebutton in php_retrieve_url_of_record

Unread postby getNo » Thu Mar 11, 2021 10:15 pm

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
2.png (48.73 KiB) Viewed 671 times


If im already logged in, theres no navigation
1.png
1.png (46.86 KiB) Viewed 671 times


But if i use a new blank "incognito-Tab" without any cookies i get this
3.png
3.png (31.76 KiB) Viewed 671 times

The HOME-Link directs to the correct Startpage. Also some bugs in the displayed forms.
getNo
 
Posts: 20
Joined: Fri Feb 19, 2021 2:26 am

Re: Homebutton in php_retrieve_url_of_record

Unread postby kev1n » Thu Mar 11, 2021 10:45 pm

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
kev1n
nuBuilder Team
 
Posts: 2057
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Homebutton in php_retrieve_url_of_record

Unread postby getNo » Fri Mar 12, 2021 4:43 am

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 = ''
 
    }
getNo
 
Posts: 20
Joined: Fri Feb 19, 2021 2:26 am

Re: Homebutton in php_retrieve_url_of_record

Unread postby kev1n » Fri Mar 12, 2021 9:41 pm

Thanks, updated on Github.
kev1n
nuBuilder Team
 
Posts: 2057
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 4 guests