Organize custom links on home screen

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
peteraj
Posts: 27
Joined: 2016-02-05 12:25

Organize custom links on home screen

Post by peteraj » 2016-03-18 12:27

Hi,

I am a very satisfied custumer, and I am very fond of the new version, 5.50! Especially the option to organize the tables into groups! but can it be done with custom links? the links created in links-home.php?

Thank you in advance

Regards
Peter

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Organize custom links on home screen

Post by shasta59 » 2016-03-29 20:06

Yes it can. Very easy to do.

Just open the links-home.php file and rearrange the order in which you wish them to appear. Copy everything between $homeLinks[] = array( and the ); to where you wish it to be. Make sure you also copy the homelinks and last bracket ); as well. (Copy first then paste then delete the original text - just in case you made a mistake.) You can put them in any order you wish.

What I have done however, in my case, since I got tired of rearranging them for different situations etc is to create a page in the admin section which shows all the links and where I want them. I fill in the details in the admin section and then it feeds them to the system in place of the link-home.php page.

This way it can be done in admin by anyone having admin rights. I have also set it so that there is a number scheme. 1, 2, 3 etc. Put in the number you wish to create the order you wish. I got tired of one client asking for changes so added this to the admin section.

But, if yours are mostly static and do not change then using the links-home file works fine. I have done the same for the navmenu page. I also have a setting in admin for the order the other tables show up in the drop down menu under the jump menu item.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

JesperWitt
Posts: 5
Joined: 2016-04-01 10:31

Re: Organize custom links on home screen

Post by JesperWitt » 2016-04-01 11:09

I believe the question is regarding the new groupings added to the menu-page in 5.50, where you can sort pages into various groups, but custom pages have no documented option on how to be sorted into the groups.

You add custom pages to "links-home.php" and they'll show up on the menu-page, but how do you choose which group they are sorted under?

Currently all custom pages are sorted under the last group that has other pages (is not empty).

Bertv
Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: Organize custom links on home screen

Post by Bertv » 2016-04-01 19:19

Hi,
there is a new item in the array for groups:
[img]
links_home.png
links_home.png (22.67 KiB) Viewed 21618 times
[/img]
Bert
I am using Appgini 5.75

JesperWitt
Posts: 5
Joined: 2016-04-01 10:31

Re: Organize custom links on home screen

Post by JesperWitt » 2016-04-01 22:42

If this is the case the description really needs some work. It sounds more like what (user) group is allowed to see the page/link.

I'll give it a go next time I play with it. (busy weekend)

peteraj
Posts: 27
Joined: 2016-02-05 12:25

Re: Organize custom links on home screen

Post by peteraj » 2016-04-06 16:15

Hi,
In the documentation, http://bigprof.com/appgini/help/advance ... r-contents it seems that the group refers to the usergroups!
So I don't think it will work...

Regards
Peter

Bertv
Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: Organize custom links on home screen

Post by Bertv » 2016-04-07 11:43

You are right: the 'groups' item is just for authorisation.
The is a new item 'table-group' in both the links_home.php and the links_navmenu.php.
links_home.png
links_home.png (112.08 KiB) Viewed 21497 times
links_navmenu.png
links_navmenu.png (12 KiB) Viewed 21497 times
See the results in my application:
menu_ver.png
menu_ver.png (76.7 KiB) Viewed 21497 times
Bert
I am using Appgini 5.75

peteraj
Posts: 27
Joined: 2016-02-05 12:25

Re: Organize custom links on home screen

Post by peteraj » 2016-04-07 16:10

Thank you Bert, just what I was looking for! :-)

But I think that I have ran into a bug, og I have made at mistake! When I add a custum link to group 0, it appears twice in group 1!! se below
tablegroup1.PNG
tablegroup1.PNG (29.53 KiB) Viewed 21489 times
$homeLinks[] = array(
'url' => 'http://.......'
'title' => 'Active tasks',
'description' => 'All active tasks',
'groups' => array('*'), // groups allowed to see this link, use '*' if you want to show the link to all groups
'table_group' => 0,
'grid_column_classes' => '', // optional CSS classes to apply to link block. See: http://getbootstrap.com/css/#grid
'panel_classes' => '', // optional CSS classes to apply to panel. See: http://getbootstrap.com/components/#panels
'link_classes' => '', // optional CSS classes to apply to link. See: http://getbootstrap.com/css/#buttons
'icon' => 'task7a.png' // optional icon to use with the link
);

Any advice or suggestions?

Best Regards
Peter

peteraj
Posts: 27
Joined: 2016-02-05 12:25

Re: Organize custom links on home screen

Post by peteraj » 2016-04-07 17:58

By the way Bert, where did you find the documentation for table_group? I can't find it anywhere, and it is not mentioned in the generated default home-links.php file! I am using Appgini 5.50 Revision 835

/Peter

JesperWitt
Posts: 5
Joined: 2016-04-01 10:31

Re: Organize custom links on home screen

Post by JesperWitt » 2016-04-11 14:00

Having the same problem as Peter. When I add "table_group" to the list of parameters, it shows up 2 times in group 1 !

/Jesper

Bertv
Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: Organize custom links on home screen

Post by Bertv » 2016-04-11 19:31

Hi,
first a correction:
in links-home.php the 'table_group' must be filled with the group name,
in links-navmenu.php the 'table_group' must be filled with the number of the table group.

See function get_table_groups in the generated script incCommon.php
It is used in home.php (about row 45). This script create the menu.

If you want te start with all groups 'closed', remove this row
$j('.collapser').eq(0).click();
or change it into
/* $j('.collapser').eq(0).click(); */
at the and ofhome.php

I am using Appgini 5.50 Revision 835
Bert
I am using Appgini 5.75

peteraj
Posts: 27
Joined: 2016-02-05 12:25

Re: Organize custom links on home screen

Post by peteraj » 2016-04-12 07:06

Thanks a lot Bert! you are my hero! It works like a charm! Now I just need to figure out how to get both the table links and the custom links, all i one row! Does anyone have a suggestion for that? or is that to complicated?

/Peter

JesperWitt
Posts: 5
Joined: 2016-04-01 10:31

Re: Organize custom links on home screen

Post by JesperWitt » 2016-04-12 21:17

Brilliant, thank you very much Bert! :)

/Jesper

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: Organize custom links on home screen

Post by ronwill » 2016-06-25 21:39

Can anyone see what I've done wrong below?

I have success with drop down menu (after uploading my links-navmenu.php, but when I upload my links-home.php shown below, ALL my menus are disappear / are not there anymore (I just have top header with Home/Signed in as + sign out button showing + my customised header below that, also no footer showing). If I delete and upload links-home back to default file everythings back as should be.

links-home.php
/*
* You can add custom links in the home page by appending them here ...
* The format for each link is:
$homeLinks[] = array(
'url' => 'path/to/link',
'title' => 'Link title',
'description' => 'Link text',
'groups' => array('group1', 'group2'), // groups allowed to see this link, use '*' if you want to show the link to all groups
'table_group' => 7 //optional number of table group (the first group is 0)
NOTE ABOVE LINE WAS NOT IN MY links-home.php default file in /hooks folder so I just added it in here!?
'grid_column_classes' => '', // optional CSS classes to apply to link block. See: http://getbootstrap.com/css/#grid
'panel_classes' => '', // optional CSS classes to apply to panel. See: http://getbootstrap.com/components/#panels
'link_classes' => '', // optional CSS classes to apply to link. See: http://getbootstrap.com/css/#buttons
'icon' => 'path/to/icon' // optional icon to use with the link );
*/

$homeLinks[] = array(
'url' => 'http://www..........',
'title' => 'New Title',
'description' => 'Name Descript',
'groups' => array('*'), // groups allowed to see this link, use '*' if you want to show the link to all groups
'table_group' = ('Group1') //optional number of table group (the first group is 0) USED A GROUP NAME AS FORUM MESSAGES ABOVE
'grid_column_classes' => '', // optional CSS classes to apply to link block. See: http://getbootstrap.com/css/#grid
'panel_classes' => '', // optional CSS classes to apply to panel. See: http://getbootstrap.com/components/#panels
'link_classes' => '', // optional CSS classes to apply to link. See: http://getbootstrap.com/css/#buttons
'icon' => 'path/to/icon' // optional icon to use with the link );


Thanks in advance for any help!
Cheers,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: Organize custom links on home screen

Post by ronwill » 2016-06-25 23:20

forgot to add:
'table_group' => ('Group1') - If I take this line out I get my menu's back but not the new link button!?

Maybe there is another file I also need to update/check?
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: Organize custom links on home screen

Post by ronwill » 2016-06-26 02:34

Sorry all,

Seems I was getting tired and making typo's, bit of copying/pasting/checking and somehow all working now!

Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

User avatar
naturick
Veteran Member
Posts: 39
Joined: 2014-07-07 18:47
Location: Cluj-Napoca
Contact:

Re: Organize custom links on home screen

Post by naturick » 2018-08-06 12:47

I have a question

I would like to give acces to custom links on home page to a specific USER not to all user of a single group.

I tried using

Code: Select all

'username' => array('nameoftheuser')
in homelinks section in links-home.php file....but don't works...

Is it possible to reach the goal?

Of course with the ability to put users on multiple groups, it would be easy....but until that day?

Thanks

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Organize custom links on home screen

Post by pbottcher » 2018-08-06 14:08

Hi,

I dont think that will work.
What you can do, if you need this, you can add

Code: Select all

'users' => array('user1', 'users'), // array of users allowed to see the custom link

in the links-home.php

and change the following in the incCommon.php file (get_home_links function // arround line 1300)

Code: Select all

if($memberInfo['admin'] || @in_array($memberInfo['group'], $link['groups']) || @in_array('*', $link['groups'])){

to

Code: Select all

if($memberInfo['admin'] || @in_array($memberInfo['group'], $link['groups']) || @in_array('*', $link['groups']) || @in_array($memberInfo['username'], $link['users'])){
 
make sure, you do not include the common group for the other users :-).

Note that this will be overwritten, once you recreate your application and you need to redo this change in the incCommon.php file.
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.

User avatar
naturick
Veteran Member
Posts: 39
Joined: 2014-07-07 18:47
Location: Cluj-Napoca
Contact:

Re: Organize custom links on home screen

Post by naturick » 2018-08-06 15:10

That's absolutly perfect. Works. THANKS

I just must to remember each time to rewrite. Until we will be able to insert users on multiple groups.

In any case, I thinks this can be a good suggestion to improve Appgini versatility.

fdissait
Posts: 23
Joined: 2019-07-24 07:57

Re: Organize custom links on home screen

Post by fdissait » 2022-08-16 13:23

Hello,
Does anybody know how to set a table link and two custom links on the same row(or line?)
Thanks for help
François

Post Reply