Home › Forums › Calendar Products › Community Events › On login view, want Register link to be button like Log In
- This topic has 8 replies, 2 voices, and was last updated 6 years, 6 months ago by Lou.
-
AuthorPosts
-
September 18, 2017 at 4:09 pm #1350903LouParticipant
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!
September 19, 2017 at 8:04 am #1351123PatriciaMemberHey 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
September 19, 2017 at 9:53 am #1351342LouParticipantThanks.
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?
September 20, 2017 at 6:43 am #1351842PatriciaMemberHi 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
September 25, 2017 at 11:33 am #1354432LouParticipantThanks 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.
September 25, 2017 at 12:18 pm #1354469LouParticipantThis 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.
September 26, 2017 at 5:06 am #1354826PatriciaMemberHi 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
October 18, 2017 at 9:35 am #1365383Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘On login view, want Register link to be button like Log In’ is closed to new replies.