Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
Themes
Demos
Documentation
Forums
Contact Us
Download
Purchase
Quotes

" ... I want to tell you that your thyme product is functional and valuable beyond words. I cannot imagine why any portal would be without it. It is the cornerstone of our new project ..."

" ... Thanks for such a complete project, its making my job much easier. ..."

" ... I have now deployed 4 different calendars and our users love them ... "

" ... Easy to install and use and a great look/design. ..."

" ... This has to be the easiest to use program I think I've had to deal with at all this year. ..."


  FAQFAQ    SearchSearch  RegisterRegister   Log inLog in 
Custom fields for events?
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic     Forum Index -> Hacking Thyme
View previous topic :: View next topic  
Author Message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Thu Jul 20, 2006 10:01 am    Post subject: Reply with quote

Hi,

Sorry for the delayed response. What you would need to do is create a javascript function for this. I'm sure google has some copy/paste code you can use. It will probably require that you set this to the onKeyDown and/or onKeyUp event for the text box. In which case for your text box you would add a 3rd argument. Something like:

Code:
$_cal_form->textbox('myfield', 32,
   "onKeyUp='only_numbers()' onKeyDown='only_numbers()'");


Where 'only_numbers()' is the javascript function you added. This function would go at the bottom of include/templates/event_edit_tpl.php.

Let me know if you have any more questions.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Jul 29, 2006 8:44 pm    Post subject: Reply with quote

Hi...

Everything works nicely after having set my categories list box in the Event Edit form to trigger the hiding/showing of different custom fields i created.

The only thing i have left is that i want all my custom fields to be hidden when the "(None)" row is selected in the categories drop down.

So i added that in the Javascript function that is triggered when the select box changes and it works, but only when "(none)" is manually selected in the dropdown. I want that piece of code in that function to be executed to start with when the form is first displayed.

So where i had:

Code:

$_cal_form->select("type", array('('._NONE_.')') + $_cal_event->cal_etypes, "' onChange='upd_custfields()'") ."");


i tried this:

Code:

$_cal_form->select("type", array('('._NONE_.')') + $_cal_event->cal_etypes, " onLoad='upd_custfields()' onChange='upd_custfields()'") ."");


But it doesn't work Sad i think the onLoad is not for that, any hints on how to accomplish this? I suspect it must be something easy.

Thanks for any help,
NiCo
Back to top
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Sat Jul 29, 2006 8:45 pm    Post subject: Reply with quote

...
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Sat Jul 29, 2006 8:53 pm    Post subject: Reply with quote

Hi Nico,

Anywhere in your code add:

Code:
$_cal_html->js_onload[] = "upd_custfields();"
Back to top
View user's profile Send private message Visit poster's website
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Fri Aug 04, 2006 2:41 am    Post subject: Reply with quote

Hi...

After putting several custom fields between span and new_row()/end_row() as discussed in this post, all this custom fields appear totally aligned to the left of the edit event form, as opposed to the standard fields which are padded a little to the right(as usual).

what would i need to do to have the custom fields show aligned with the rest of the standard fields?

Cheers,
NiCo
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Fri Aug 04, 2006 2:43 am    Post subject: Reply with quote

Hi,

Instead of using new_row()/end_row() use section_row(). E.g.

$_cal_tmpl->section_row("Field label", $_cal_form->textbox('x'));
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Fri Aug 04, 2006 2:51 am    Post subject: Reply with quote

mmmm...

You recommended the new row() and spans so i could group certain custom fields in groups to show/hide them depending on event category chosen(take a look at the previous page of this post).

So i think if i change all back to section_row... i'll change the current functionality, right?
Back to top
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Fri Aug 04, 2006 2:52 am    Post subject: Reply with quote

...
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Fri Aug 04, 2006 3:13 am    Post subject: Reply with quote

Then keep the new_row()/end_row()? The other fields appear aligned because they use section_row(). It would be a lot easier to recommend something if I could see it. Could you give me the URL please?

Thank you
Back to top
View user's profile Send private message Visit poster's website
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Mon Aug 07, 2006 4:20 am    Post subject: Reply with quote

So does that mean that i won't be able to put those groups of custom fields(i used spans and new row()) in a new section?

Cheers,
NiCo
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Mon Aug 07, 2006 10:21 pm    Post subject: Reply with quote

Hi,

It depends on how you would like them displayed. You can still use:

$_cal_tmpl->section_row("", "<span id='x'> ...");

Those are the two options. That would leave a space in the screen if that is hidden. Try both ways and see which one you like best.
Back to top
View user's profile Send private message Visit poster's website
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Tue Sep 19, 2006 5:29 pm    Post subject: Reply with quote

ian wrote:
Hi Nico,

Anywhere in your code add:

Code:
$_cal_html->js_onload[] = "upd_custfields();"


Hi ian,

When i used the add event in wrapped mode, the javascript function worked nicely both when i change a category and also in the loading on the form.

However, now that i started using the Joomla Studio add event component, it only works on change, but not on load.

Any clue why?

Cheers,
NiCo
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Tue Sep 19, 2006 5:40 pm    Post subject: Reply with quote

Yes. When thyme is embedded in Joomla Studio, $_cal_html->print_footer() is not activated. This is where the JavaScript would be printed. Another solution would be to add this at the bottom of the Joomla Studio page where the event add/edit form is after ?>:

Code:
<script language='javascript' type='text/javascript'>
upd_custfields();
</script>
Back to top
View user's profile Send private message Visit poster's website
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Tue Sep 19, 2006 5:46 pm    Post subject: Reply with quote

that was it...thanks Wink
Back to top
View user's profile Send private message
smeallum



Joined: 17 May 2006
Posts: 177

PostPosted: Sun Nov 05, 2006 7:14 pm    Post subject: Reply with quote

ian wrote:
Hi Kent,

This will require some PHP knowledge. You may add custom fields to events by:

Let's say the field is called Price.

1) Adding the field to the Events table. You may do this through any SQL server admin program. MyPHPAdmin etc.. Create a field in the table called Price.

2) Adding the field to include/templates/event_edit_tpl.php. Add a text box to the form where users may enter a price. Make sure to name the text box 'Price'. You can do this by adding something like:

$_cal_tmpl->section_row("Price", $_cal_form->textbox('Price'));

3) Adding Price to include/templates/event_view_tpl.php. You could do something like:

$_cal_tmpl->section_row("Price", $_cal_event->Price);

Don't hesitate to ask any questions if you have them.


ian...

what about the request events table and the passing from there to the events table when the event is apprved? Doesn´t the custom fields need to be added there too?

Cheers,
NiCo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Hacking Thyme All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2005 eXtrovert software unless otherwise noted. All rights reserved.
Portions © 2004 Ben Brown. All rights reserved.
Trademarks are property of their respective owners.