Drop down categories on homepage.
Drop down categories on homepage.
Hi, on your Northwind demo you have drop downs where tables live and can be separated. i.e. Sales/Operations/Catalog. How is this acheived? I've set the Table Group up in Appgini and assigned tables to the groups but they don't show on the homepage. I'm using the very latest Appgini 5.98. And emptied cached - totally regenerated all files and it doesn't seem to work for me. Where would one look to work this out? Thank you. Mark
Best Wishes,
Mark
Mark
Re: Drop down categories on homepage.
That should be all that's necessary, assuming the Groups/tables are assigned correctly?I've set the Table Group up in Appgini and assigned tables to the groups but they don't show on the homepage
Check incCommon.php around line 40 for this function (first function under the notes):
Code: Select all
function get_table_groups($skip_authentication = false) {
$tables = getTableList($skip_authentication);
$all_groups = ['None', 'Group 1', 'Group 2', 'Another Group'];
Re: Drop down categories on homepage.
Thanks peebee. The code was there. I think it may have been the fact I only had set up one Group to test. I added another field with a different Group and it works fine now.
Best Wishes,
Mark
Mark
Re: Drop down categories on homepage.
Just another quick thing related to these Groups on the homepage. How would one go about not having the first Group open by default? So you go to the homepage and all Groups are closed, until one is clicked on?
Best Wishes,
Mark
Mark
Re: Drop down categories on homepage.
(1) Simpe solution with backdraw
Remove that line from
Attention
This file will be overwritten on next code-generation.
Remove that line from
home.php
:Code: Select all
$j('.collapser:visible').eq(0).click();
This file will be overwritten on next code-generation.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Drop down categories on homepage.
(2) Pure hooks-only solution
If you need a hooks-only solution, this becomes more complex. We have to cancel opening the first panel on load but keep click-handler for follow up-clicks on panel-headers. AppGini automatically changes the arrow-icon ("chevron") on load from right-arrow to down-arrow, and we have to reset it on initial load, too.
Code
The following copy & paste-ready code works for me:
Result
After reload with my code enabled, the homepage looks like this:
All panels are collapsed, chevron-icons indicate "closed" status and click handler still works.
Note
As this is a hooks-only solution, this will not be overwritten on next code-generation.
If you need a hooks-only solution, this becomes more complex. We have to cancel opening the first panel on load but keep click-handler for follow up-clicks on panel-headers. AppGini automatically changes the arrow-icon ("chevron") on load from right-arrow to down-arrow, and we have to reset it on initial load, too.
Code
The following copy & paste-ready code works for me:
Code: Select all
<!-- file: hooks/header-extras.php -->
<script>
var initial_load = true;
jQuery(document).on("show.bs.collapse", function(e) {
if (initial_load) {
initial_load = false;
e.preventDefault();
let id = jQuery(e.target).attr("id");
jQuery(`a.collapser[href='#${id}']`).find("i.glyphicon").toggleClass("glyphicon-chevron-down glyphicon-chevron-right");
}
});
</script>
After reload with my code enabled, the homepage looks like this:
All panels are collapsed, chevron-icons indicate "closed" status and click handler still works.
Note
As this is a hooks-only solution, this will not be overwritten on next code-generation.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Drop down categories on homepage.
That works like a treat. Love this hook solution. Thanks jsetzer.
Best Wishes,
Mark
Mark