Home › Forums › Calendar Products › Community Events › Template issue in custom theme
- This topic has 9 replies, 5 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
June 6, 2012 at 9:18 am #20248
Marc
ParticipantHi there
I’ve installed the Community plugin and it works great! I’m having a couple of issues with the templating though and I was hoping some of you might help me.
I have a custom template for my event page (http://www.smf-schweiz.org/events/) and I want the same template on my page with the Community Event form (http://www.smf-schweiz.org/events/community/add/). For some reason the page with the form pulls in my default template and I don’t know why. I have all the right folders and files in the right directory mytemplate/events/community and I have edited them to my needs. For some reason the form page pulls in the wrong template anyway.My second issue is that I would like to split the form up in half and display it side by side. I have found a way to display/hide certain blocks of the form but not how I can splitt it up anywhere I want. I hope this explenation makes sense… 🙂
Any help would be appreciated – thank you guys!
June 7, 2012 at 10:58 am #20324Jonah
ParticipantHi Marc,
The Community Events plugin currently will use your theme’s page.php template and there’s no way around this that I know of. In 1.0.1 we added a couple conditional functions for you to be able to check what CE page you are on so you can use these to change things up a bit on the CE pages.
There’s tribe_is_community_edit_event_page() and tribe_is_community_my_events_page() and you can use them in your page.php theme template to adjust the code accordingly. Here’s a sample to get you started:
if(tribe_is_community_my_events_page()) {
echo 'were on the my events page';
} elseif(tribe_is_community_edit_event_page()) {
echo 'were on the add/edit events page';
}
As for splitting the forms up you can do all of this via CSS in your themes style.css file targeting the various blocks you want to reposition.
I hope that helps!
– Jonah
June 11, 2012 at 11:54 pm #20547Marc
ParticipantHi Jonah!
Thank you for helping me and the sample to get started. I will try it and give you feedback later this week.
Cheers, MarcJune 12, 2012 at 7:58 am #20555Jonah
ParticipantYou’re welcome Marc, I hope that works out for you!
– Jonah
July 31, 2012 at 5:29 am #22987Marc
ParticipantFirst of all – apologies that it took us so long to write back.
We’ve tried a bunch of different things but couldn’t really solve the problem. We did find a workaround solution for the page.php problem though and that seems to work for us so far.What we still can’t accomplish is to split the form into two pieces so we can display it in columns. Unfortunately we couldn’t accomplish that through targeting the various blocks with CSS as you suggested. Could you provide us with an example here by any chance?
We were able to hide certain parts of the form e.g. Event Details (which unfortunately includes event time, venue, etc.) – so that doesn’t really do the trick.Looking forward to hearing from you and thank you in advance,
MarcAugust 1, 2012 at 7:16 pm #23101Rob
MemberHey Marc. Thanks for the follow-up here, and no worries about the delayed response. I will note that since you last visited the forum Jonah has left on sabbatical and won’t be back for another month or so.
As such I’ve asked another member of the dev team to poke their head in here and see if they can offer up any advice in light of your last note and what Jonah has provided already. Stay tuned and thanks for your patience so far.
August 6, 2012 at 10:30 am #23300Ryan
MemberHi Marc, I’m poking my head in to see how I can help out with styling up your form. Quick question for you, how, specifically are you wanting to split up the form (or put a different way, beginning where in your form are you wanting to have the 2nd column)?
August 6, 2012 at 11:58 am #23301Marc
ParticipantHi Ryan – thanks for looking into it.
It’s tricky to find out where exactly we want to split it up – since the website has a fixed height and we just want to fit the form in there in 2 columns. I think it would make sense if we could split it before the ‘Venue Details’ (or in our case ‘Details zum Veranstaltungsort’ as seen on http://www.smf-schweiz.org).Any hint would be really helpful and appreciated.
August 6, 2012 at 12:17 pm #23302Ryan
MemberHey Marc, so here is a sample for customizing the form a bit so you can do what you want with your columns. There are several different things that need to be done, so please let me know if you have any questions regarding the following, and just a note, depending on what you’re wanting to do, may take more or less time on your part:
1) We need to customize the markup of the form itself a bit. Basically we need to place a parent container around our “columns” where want to create our columns. So this plugin, as well as the Events Calendar, has the incredible ability to allow us to customize a whole template of the plugin, which is what we need to do. If you don’t already have one, create a new folder in your active WordPress theme directory called “events”, and inside that folder create another folder called “community”.
2) Now to customize our markup. Inside your newly created “community” folder, add a new file called “events-meta-box.php”. Now if you look at the actual Community plugin, specifically in the “views” folder, there is a file that has the same name. Copy everything out of this file and paste this into your newly created file and save.
For the markup, and this is just an example, you could do anything and anywhere you want to create your columns (for this example I’m splitting everything below the Event Categories to the Cost input into columns, based on your current pg), In the “events-meta-box.php” add “” directly above this bit “”, should be around line 34. Then add “” directly above this bit “” tag around line 121. Finally, add “!– .smf-column –>” above the final closing “” tag around line 147.
3) Now all you need to do is target the markup with CSS to accomplish what you want, which would be something like the following (or might be a bit different depending on your theme’s styles and css going on):
.smf-column {
float: left;
width: 45%;
}
You may also find you need to put a “clear: both” on the element following the columns. That’s the basic idea, and to do something like splitting the complete form into two columns is possible, but you may need to rewrite a good portion of the markup in the whole form to accomplish this.Hope this helps!
July 7, 2015 at 6:25 am #977511Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Template issue in custom theme’ is closed to new replies.
