Better Documentation on User Dashboard customization

Discussion in 'Customization & add-ons' started by microlinx, Jul 28, 2017.

Thread Status:
Not open for further replies.
  1. microlinx

    microlinx aMember Pro Customer

    Joined:
    Oct 26, 2004
    Messages:
    247
    I am aware of the very brief documentation on how to customize the user dashboard at: http://www.amember.com/docs/How_to_add/remove_html_blocks_in_member's_area

    However, it is so limited as to not be very helpful.
    What I would like to see is separate, sort-able blocks for each protection type on the user dashboard:
    Folders
    Files
    Pages
    Links
    Video
    Newsletters

    Right now "Active Resources" contains a difficult to sort mixture of all of the above.
    I would like to be able to group selection by the types listed above, making the easier top sort within each group.

    There really should be better documentation and possibly a few examples to do this on our own without having to work only with support to get it done. I realize you want to keep us in paid support, but I am already under a support contract but want the freedom to do this on my own.
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,686
    Hello,

    First of all you can sort all resources at
    aMember CP -> Protect Content -> tab All
    (Just drag & drop records to sort it)
    resource-sort.png

    I am afraid each widget is unique so it is necessary to write tutorial for each block.
    Common interface described here:
    http://www.amember.com/docs/How_to_add/remove_html_blocks_in_member's_area

    We have free Widget plugin that allow to add widgets from admin interface and show/hide it based on user access.
    These widgets allow you to use HTML and user specific placeholders to personalize widgets (%user.name_f%, %user.name_l%, %user.eamil% etc.).
    https://www.amember.com/amember/product/widget

    In event of you need to have some complex behavior in widget then it is necessary to know PHP to implement it.
    One of aMember advantage is its code is open and you can read it if necessary.

    Here is example of code that add separate widget with files to user dashboard. This code can be used in site.php:
    http://www.amember.com/docs/Site.php_file

    PHP:
    if ($user Am_Di::getInstance()->auth->getUser()) {
        if (
    $files Am_Di::getInstance()->resourceAccessTable->getAllowedResources($userResourceAccess::FILE)) {
            
    Am_Di::getInstance()->blocks->add(new Am_Block('member/main/left''Your Downloads''files'null,
                function (
    Am_View $v) use ($files) {
                    
    $out '';
                    foreach (
    $files as $f) {
                        
    $out .= sprintf("<li>%s</li>\n"$f->renderLink());
                    }
                    return 
    sprintf('<ul class="am-widget-list">%s</ul>'$out);
                }));
        }
    }
    Other content type constants is:
    PHP:
    ResourceAccess::FOLDER
    ResourceAccess
    ::PAGE
    ResourceAccess
    ::LINK
    ResourceAccess
    ::FILE
    ResourceAccess
    ::VIDEO 
    We are always happy to help with widget development.

    Best Regards.
  3. microlinx

    microlinx aMember Pro Customer

    Joined:
    Oct 26, 2004
    Messages:
    247
    Awesome reply caesar! I was not aware of those extras. I think the Widget add on is exactly what I need.
    Thanks a million!
    caesar likes this.
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,686
    You are welcome!
Thread Status:
Not open for further replies.

Share This Page