On login view, want Register link to be button like Log In

Home Forums Calendar Products Community Events On login view, want Register link to be button like Log In

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1350903
    Lou
    Participant

    Using community events. Even when asked to register first, people are missing the Register link on the bottom of the Log In form.

    Is there any way to format this as a button like the Log In button?

    I see the a tag is within a div with class register, but would appreciate if you help me with the required css.

    thanks!

    #1351123
    Patricia
    Member

    Hey Lou,

    Thank you for reaching out to us!

    I’m afraid we don’t have a template override to change this specific page, but you can achieve what you want by modifying the Main.php file (line 1869) in:

    wp-content/plugins/the-events-calendar-community-events/src/Tribe/

    To get started, I would suggest you to to replace this code:

    wp_register( '<div class="register">', '</div>', true );

    with something like:

    wp_register( '<button class="register">', '</button>', true );

    I hope this helps you get started! Let me know if you need anything else in the mean time and I’ll be happy to assist!

    Best regards,

    Patricia

    #1351342
    Lou
    Participant

    Thanks.

    Is there any way to keep this from getting overwritten when a new release comes out? E.g., if I copy Main.php to wp-content/themes/<theme>/tribe-events/community and modify that version, will the themes version take precedence? I think you are saying that won’t work.

    If not how do I do this in a way that would survive an update to community events?

    #1351842
    Patricia
    Member

    Hi Lou,

    I totally agree, this is not ideal indeed: any customization you implement on Main.php will be lost after plugin update.

    I’ve reviewed the Main.php file and since we don’t have a hook to specifically change this piece of information (only before and after it), I came up with a workaround that might help you to achieve what you want:

    Please add the following snippet in the end of your theme’s functions.php file (without the <?php tag):

    https://gist.github.com/nefeline/c3d62de20b0aeae68fc59e5fddcc01b4

    This snippet will add a new Register button in your CE Login Form.

    Now we have to hide the previous register class and only display the button we just created. You can do this via CSS. Please add the following code in your theme’s style.css file:

    .register {
        display: none;
    }

    I hope this helps! Let me know if you need anything else in the mean time and I’ll be happy do assist!

    Regards,

    Patricia

    #1354432
    Lou
    Participant

    Thanks for the guidance. I just came up for air on some other stuff I was working on, and will start looking at this solution and report back. I am only commenting here, now, to forestall any automated closure which might happen in the time I am looking at it.

    #1354469
    Lou
    Participant

    This problem is resolved.

    You gave me the idea. I replaced the div tag with classes that a) will be handled some with tribe styles, and, b) add some of my styles. See https://codepen.io/louking/pen/JrKgqq which copies the tribe styles for .tribe-community-edit .button-primary and .tribe-community-edit .button, and also is enhanced with .my-button styles (which I have in my theme).

    I think if I use a button I have to mess with form tags and javascript to handle the submission.

    #1354826
    Patricia
    Member

    Hi Lou!

    I’m glad to know you were able to customize the register text. Your div wrap is certainly better than the default button class I used as an example to help you get started! Nice job!

    Let me know if you have any other questions in the mean time and I’ll be happy to assist!

    Best regards,

    Patricia

    #1365383
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘On login view, want Register link to be button like Log In’ is closed to new replies.