Question on passing values with the Javascript Templating

Home Forums Calendar Products Events Calendar PRO Question on passing values with the Javascript Templating

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #992742
    Dan Feeley
    Participant

    Not sure if you can help but I have a question on using the Javascript Templating System for customizations.

    I use ACF to store/retrieve custom values and one of those values is comma delimited
    (e.g. “apple,banana,orange”). I can setup the array and can pass the data to the mobile.php (which I can echo out from there) but is it possible to split the values on the month side?

    $get_fruit = get_field( ‘fruits’, $post );

    $additional_values = array();
    $additional_values[‘fruit’] = $get_fruit ;

    Usually I can use php explode to divide them up but that doesn’t appear to work in the mobile.php unless I’m formatting the statement wrong. Or do I need to split the values out in the month single-event and send them individually?

    I hope that makes sense.
    Thank You.

    #992868
    Brian
    Member

    Hi,

    Thanks for using our plugins I can try to help out here.

    Where are you trying to show the values? For each event? Or for the month view in general?

    Let me know and I can try to make some suggestions.

    Cheers

    #992918
    Dan Feeley
    Participant

    I am trying to show the values for each event in the mobile month view.
    ../theme/tribe-events/month/mobile.php

    #993132
    Brian
    Member

    Hello,

    Thanks for answer that.

    I played around with my test site and there is the option you already mentioned:

    To use php explode to separate the values before sending them to the script.

    Or you could use spilt() in javascript to do it there and display how you like, but that might be tricker with the template.

    If I was working on this I would explode before sending and then just use the template to display the values.

    Cheers

    #993141
    Dan Feeley
    Participant

    OK, thank you. I wanted to make sure I was going about it the best way.

    #993184
    Brian
    Member

    Yeah either way could be the best way, so whatever you are comfortable with I would go with that.

    Cheers

    #997190
    Support Droid
    Keymaster

    This 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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Question on passing values with the Javascript Templating’ is closed to new replies.