Forum Replies Created
-
AuthorPosts
-
September 10, 2015 at 12:35 pm in reply to: Venue name and City are required after update….when they're in the Saved Venue #1003854
Mad Dog
ParticipantFurther testing….I can add an event using a New Venue but get the same errors mentioned above whenever I try to use a Saved Venue.
Mad Dog
ParticipantThanks for keeping up with this. I got an email that the new release is pending. Do you have an ETA? There’s one thing in particular (CSV import handling custom fields) that is important…wondering how long I’ll need to wait.
One other question: I’ve done a good bit of customizing. The one file in particular that I see will have a lot of change is Community Events edit-event.php. Being new to customizing EC, will there be some guidelines to help me know what I’ll need to do to adapt the new page? Can I just add a new module from the new page to mine? Or will I have to add my changes (lord knows I’ll need to remember them!) to the new file?
Thanks
Mad Dog
ParticipantFor anyone wanting to add a Character counter to a text area (such as in the Add an Event or Modify an Event pages), here’s what I did that worked really well. It’s based on http://jsfiddle.net/X28Xe/2/ which came from I believe a post on Stack Overflow but I lost track of it so I can’t give the original person credit. Sorry. But thanks to him!
<script> jQuery(document).ready(function ($) { // Set your character limit var count_limit = 10; // Set the initial symbol count on page load $('#excerpt-wc span').text($('#excerpt').val().length); $('#excerpt').on('keyup', function () { var char_count = $(this).val().length; var excerpt = $(this).val(); // Update the character count on every key up $('#excerpt-wc span').text(char_count); if (char_count >= count_limit) { $('#excerpt-wc').css('color', 'red'); $(this).val(excerpt.substr(0, count_limit)); } else { $('#excerpt-wc').css('color', null); } }).after('<p id="excerpt-wc">Count: <span>0</span></p>'); }); </script>Basically, change the ID “excerpt” to whatever your textarea ID is. Do keep the “-wc” suffix though! Change the character count and you’re good.
I’m using this in the file: edit-event.php
If you want to use this for the Description textarea you have to add a line to the top of the code. For some reason that textarea has no ID so you need to add this right after the opening <script>:
// Add ID to Description textarea $('textarea[name=tcepostcontent]').attr('id','tcepostcontent');Make sure “tcepostcontent” is the name of that textarea (it was for me) and if you want to use a different ID change the last one on the line.
I first added this in the child verstion of edit-event.php but decided to keep things cleaner and pull it out. I created a function using “tribe_events_community_before_the_content” to insert it. I might put it in a separate .js file and just call that file into the page with a function….(see following response from support about that).
I hope this is clear!
MD
Mad Dog
ParticipantWell, I got it all working, including adding an ID to the text area. In a few minutes I think I’ll post my solution here so anyone searching can see it.
One (hopefully) last question: I pulled the <scripts> out of the child version of edit-event.php and am inserting it via a function using tribe_events_community_before_the_content. It works fine. Okay, two questions:
– Is there a better hook to use?
– I actually feel like it would be better to put this into a .js file and then use the hook to call that file. Seems cleaner (and less cluttered in functions.php). If that sounds like a good way to go, where should I put the .js file and how should I call it? I’m not sure where in the child file structure under theme/tribe-events/etc it should go.
Pretty slick!
Mad Dog
ParticipantYeah…probably not worth that, but I’ll check with the client and see.
If I could access it as a plain post in WP admin I could change the author but there doesn’t seem to be a way to do it.
Might have to tell the client we can import them okay but the users can only work with new events they add from then on.
Thanks!
Mad Dog
ParticipantWhen I look at the raw Post Edit in WP (text view without TinyMCE) and inspect it, the TextArea has a Name, ID and Class.
Mad Dog
ParticipantSounds like no matter how I do it there will be hand work involved. I’m not importing from a WP set-up even….it’s an old Perl script the client’s been using for 12 years! I was going to modify the CSV it exported to work with it but it sounds like it’s going to be messy.
If I did import them, is there a way to after the fact assign them to various users?
Mad Dog
ParticipantThanks for the kind words. I added this in a child file so it won’t be affected by a plugin update though I will take it out of there.
I’ll mess with the jQuery though that’s not my area of expertise. I still find it odd that the textarea element for Description on the Community Events Add/Modify screen has a Name (tcepostcontent) assigned but not an ID assigned to it. Especially since my Custom Field textarea has both. Is this a coding oversight?
MD
Mad Dog
ParticipantThis reply is private.
Mad Dog
ParticipantI can’t believer you’re making me break all the rules by editing the plugin!
(:})
I made the change, no problem. Any way to be on a list to be updated when this is fixed so I can do it right?
Thanks.
Mad Dog
ParticipantEasy change. THANKS
Mad Dog
ParticipantThis reply is private.
Mad Dog
ParticipantPerfect! Thanks.
Now…why is this datepicker so much nicer and convenient to use than the one on the List Events Search Bar??
Mad Dog
ParticipantThanks. I should be able to get this changed. I’ve been making lots of these changes but the template hierarchy gets complicated and the Themer’s Guide doesn’t list all the module files. Maybe the Guide can be updated to include the module files — I never would have guessed bar.php was the one without drilling down through a couple of other template files first.
Mad Dog
ParticipantThanks….kind of strange that they forgot this page. (:})
-
AuthorPosts
