Hello,
I want to remove border and title of the table which I defined in below code. I also want to set height of this table. This table will be visible for only anonymous users/ guest users. My objective is to create simple HTML page for the guest users with my business details. Please help me how can I achieve this.
I have used attached code in hooks/links-home.php
Attached images show my code and guest html page requirements
How to create special HTML page for Guest users
How to create special HTML page for Guest users
- Attachments
-
- 2020-03-26 18_26_28-C__xampp_htdocs_AG_orpm_app_hooks_links-home.php - Notepad++.png (26.52 KiB) Viewed 4737 times
-
- guestuserTable1.png (64.01 KiB) Viewed 4737 times
Re: How to create special HTML page for Guest users
My guest user page should look as given in the attached image
- Attachments
-
- 2020-03-26 19_11_23-Rental Property Manager _ Homepage.png (44.04 KiB) Viewed 4732 times
Re: How to create special HTML page for Guest users
Hi,
you can use javascript through the hooks/header-extras.php file to manipulate the DOM to your needs (e.g. $j('.btn.btn-block.btn-lg.btn-info').remove() would remove the title bar). You need to make sure that you only catch the index page for users not logged in the system (this you can verify by checking the memberinfo group for the user calling the site)
As alternative you could also create a custom page and redirect the non-logged in user to that page which gives you more flexibility to my opinion.
you can use javascript through the hooks/header-extras.php file to manipulate the DOM to your needs (e.g. $j('.btn.btn-block.btn-lg.btn-info').remove() would remove the title bar). You need to make sure that you only catch the index page for users not logged in the system (this you can verify by checking the memberinfo group for the user calling the site)
As alternative you could also create a custom page and redirect the non-logged in user to that page which gives you more flexibility to my opinion.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to create special HTML page for Guest users
Thanks for your response, my dear Friend.
I did further analysis in the last few days to reach my goal and found solution. For those looking for solution with code, I am giving the solution below. Below code will create the Guest user / Anonymous user HTML page as given in the attached image. You can update and design your own HTML page by updating "$htmlCode1" variable.
<!-- Follow below 3 steps, for Guest HTML page Design -->
<!-- Step1:
Go to Appgini > Set any one table (Ex: "TableA") as, "Hide link in homepage".
Go to "Application Login > Admin Area > Edit anonymous permission".
Set view permission as "owner" for above "TableA" and "Save" -->
<!-- Step2: put below JS code in home.php at the bottom of file, before footer call -->
<script>
var x = document.getElementsByClassName("panel-body-description");
document.getElementById("custom_links").innerHTML = x[0].innerHTML;;
</script>
<?php include_once("$currDir/footer.php"); ?>
<!-- Step3: Put below php code in hooks/links-home.php -->
<?php
$htmlCode1 ='<div style="padding:10px 10px; border:1px solid red">
<p style="padding:10px 10px; border:1px solid green"> <br>A1<br>A<br>A<br>A<br>A5<br>A<br>A<br>A<br>A<br>A10</p>
</div>';
$homeLinks[] = array(
'url' => '',
'title' => '',
'description' => $htmlCode1,
'groups' => array('anonymous')
);
?>
I did further analysis in the last few days to reach my goal and found solution. For those looking for solution with code, I am giving the solution below. Below code will create the Guest user / Anonymous user HTML page as given in the attached image. You can update and design your own HTML page by updating "$htmlCode1" variable.
<!-- Follow below 3 steps, for Guest HTML page Design -->
<!-- Step1:
Go to Appgini > Set any one table (Ex: "TableA") as, "Hide link in homepage".
Go to "Application Login > Admin Area > Edit anonymous permission".
Set view permission as "owner" for above "TableA" and "Save" -->
<!-- Step2: put below JS code in home.php at the bottom of file, before footer call -->
<script>
var x = document.getElementsByClassName("panel-body-description");
document.getElementById("custom_links").innerHTML = x[0].innerHTML;;
</script>
<?php include_once("$currDir/footer.php"); ?>
<!-- Step3: Put below php code in hooks/links-home.php -->
<?php
$htmlCode1 ='<div style="padding:10px 10px; border:1px solid red">
<p style="padding:10px 10px; border:1px solid green"> <br>A1<br>A<br>A<br>A<br>A5<br>A<br>A<br>A<br>A<br>A10</p>
</div>';
$homeLinks[] = array(
'url' => '',
'title' => '',
'description' => $htmlCode1,
'groups' => array('anonymous')
);
?>
- Attachments
-
- 2020-03-29 15_36_11-Rental Property Manager _ Homepage.png (78.98 KiB) Viewed 4641 times
Re: How to create special HTML page for Guest users
Hi,
glad you found your solution. Just remember that the home.php file will get overwritten once you regenerate your application. So make sure your changes do not get lost.
glad you found your solution. Just remember that the home.php file will get overwritten once you regenerate your application. So make sure your changes do not get lost.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to create special HTML page for Guest users
That is correct. Every time you regenerate your project code, "home.php" file will be regenerated. So, you need to redo "Step2" given above.
This forum is a great place to learn. I would like to thank Appgini for setting up this forum. I also like to thank so many friends who are contributing and posting solutions in this forum. I myself learned so much from multiple other posts, in this forum.
Re: How to create special HTML page for Guest users
Thanks @ndoddindoddi wrote: ↑2020-04-01 15:33That is correct. Every time you regenerate your project code, "home.php" file will be regenerated. So, you need to redo "Step2" given above.
This forum is a great place to learn. I would like to thank Appgini for setting up this forum. I also like to thank so many friends who are contributing and posting solutions in this forum. I myself learned so much from multiple other posts, in this forum.
If you're using AppGini 5.82, this new feature might be of use:
- Override default home.php if hooks/home-custom.php exists, allowing creation of advanced custom dashboards.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: How to create special HTML page for Guest users
Thanks @ahmed.
"hooks/home-custom.php" is giving me blank page, so that I can design my own dashboards for both guest users and logged-in users. This is a great feature.
But table dropdown menus are missing in the header for the logged-in user, as shown below.
How can I show these menus ?
"hooks/home-custom.php" is giving me blank page, so that I can design my own dashboards for both guest users and logged-in users. This is a great feature.
But table dropdown menus are missing in the header for the logged-in user, as shown below.
How can I show these menus ?
Re: How to create special HTML page for Guest users
Sorry for the long delay ... these drop-downs don't show in the homepage, so they don't show in the home-custom one as well ... but I'll consider adding an option to override this in future releases.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: How to create special HTML page for Guest users
Thanks for the response, Ahmed.
Thanks,
ndoddi
Thanks,
ndoddi