• Resolved evollo

    (@evollo)


    At the bottom of the Profile form there is a Member Directory button. How can I change the link target? We have 3 directories. When the visitor clicks the Member Directory button on the Profile form, they should be taken back to the specific directory from which they came.

    I have been able to create a custom Profile Form and a custom Profile Template for each directory, but how can I change the php code in the custom template to redirect the button link path.

    Am I on the right track?

    If this is not possible, how can I hide the Member Directory button on the Profile form?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • @evollo

    At the bottom of the Profile form there is a Member Directory button.

    This button is entered to your profile page by you using an Elementor button and the link is supplied by you not UM.

    Look for the Elementor button after the UM shortcode when editing your profile page if you want to delete the button.

    @evollo

    You can add this shortcode [um_go_back_link] to your UM profile form
    which will take the user back to the last visited page.

    Code snippet for the shortcode:

    add_shortcode( 'um_go_back_link', 'um_go_back_link' );
    
    function um_go_back_link() {
    
        return '<button class="um-button" onclick="goBack()">Go Back</button>
    
            <script>
            function goBack() {
            window.history.back();
            }
            </script>'; 
    }

    Add the code snippet to your child-theme functions.php file
    or use the “Code Snippets” plugin

    https://www.ads-software.com/plugins/code-snippets/

    Thread Starter evollo

    (@evollo)

    The ‘Go Back’ button works, thank you!

    The [go_back_button_link] shortcode did not function within the Elementor button widget, so it is styled a differently than other buttons. Would also be nice to display a back arrow symbol preceeding the ‘Go Back’ text. But most importantly, the main problem is solved.

    I am still trying to sort out navigation on the /member/ profile pages when they are called from different directories. In our public directories, only the ‘Go Back’ button is needed. The additional navigation buttons are necessary in the restricted directory for logged-in users but should not display in the public directories. I know UM has shortcode to hide/show content within a page, but I cannot get it to work with Elementor widgets. Elementor sees the shortcode start, but does not recognize the shortcode end. I can only get UM’s show/hide shortcodes to work in a block of html text.

    @evollo

    For a back arrow you can add in front of the text &laquo; Go Back

    For styling the button change the class to class="elementor-button"

    For the buttons only for logged-in users use:
    [um_go_back_link restricted="yes"]

    The updated shortcode snippet for all these cases:

    add_shortcode( 'um_go_back_link', 'um_go_back_link' );
    
    function um_go_back_link( $atts ) {
    
        if( !empty( $atts['restricted'] ) && $atts['restricted'] == 'yes' && !is_user_logged_in() ) return '';
        
        return '<button class="elementor-button" onclick="goBack()">&laquo; Go Back</button>
    
            <script>
            function goBack() {
            window.history.back();
            }
            </script>'; 
    }
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    • This reply was modified 3 years, 1 month ago by missveronica.
    Thread Starter evollo

    (@evollo)

    I’m happy with the function of the ‘Go Back’ button. I may just use that alone and remove the Elementor button widgets for restricted navigation. There are too many problems with them.

    Elementor widgets do not respect UM shortcode, so I cannot use UM shortcode to control when an Elementor navigation button displays. The style class="elementor-button" was also problematic with the UM shortcode in Elementor, as it added padding beyond the widget container.

    Another challenge is that our conditional button navigation requirements also depend upon the directory from which the /member/ profile is called. Controlling this would require too much customization.

    Thank you for all your assistsance!

    Thread Starter evollo

    (@evollo)

    I discovered Elementor has its own show/hide element function. I was able to make that work for the Elementor navigation buttons.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know how you’ve resolved the issue.

    Regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change Member Directory button on Profile form’ is closed to new replies.