Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3807
    Jordi Altimira
    Participant

    Hello again!
    I think It could be usefull allowing theme folder to contain php template files, as well as other php files (with plugin customization), to be easily portable and version independent.

    I’ll be inmerse in exams for a month, I hope to dedicate more time to this magnific plugin then after.

    Regards,
    Jordi

    P.S. Is there a way to modify login password?

    #3808
    Bartosz
    Keymaster

    Jordi, you can copy all the plugin template files to your theme to adjust it – the plugin is searching for the template files in your theme first and if it can’t find it, goes to the plugin folder.

    When it comes to other files – there’s a file: inludes/functions-template.php. Each of the functions included there can be copied to your theme’s functions.php and modified – then it will be used instead those shipping with the plugin.

    #3825
    Jordi Altimira
    Participant

    Right, but as far as I’ve seen, that only allows to store templates within your theme, not any change made to anyother php file, such as ‘metaboxes.php’ or ‘functions-template.php’ (which would need a folder to avoid the possibility to meet several files with same filename).

    It’s not a bug or error… so I haven’t posted this there: the above request is related to possible field customization (beyond custom fields, as ‘metaboxes.php’ affects to all events, not only one), or ‘functions-template.php’, where It would be usefull to include, at least <span> tag to every piece of information, in organizers and location, in order to achieve style format, in the same way it can be done with tickets.

    Thank you!
    Jordi

    #3827
    Bartosz
    Keymaster

    Exactly, other files except templates contain core plugin functions – loaded in a class, usually much earlier than any theme files. Basically it just can’t work that way.

    I’m not sure if I understand you clearly but all functions available in functions-template.php can be easilly replaced by just copying to your theme’s functions.php – there will be no conflict (those are called pluggable functions). It means that if you have 2 functions with the same name (one in plugin and second one in your functions.php) the second one will be used. This way you can customize the output of most of the event details (including organizers and location as well) without changing a single line of plugin code.

    #4113
    Jordi Altimira
    Participant

    Hi! I’m back from exams!! :D
    Well I’ve included fixed fields I needed to my “events custom type”, as whereas it’s possible to add any custom field, it’s a bit annoying to add it to every single event, in every single language… so I did it this way:

    1. 1. Modified ‘metaboxes.php’ file, located at ‘plugins/events-maker/includes’ folder:
      • a) Adding custom(s) metabox(es).
      • b) Adding corresponding function, to show label and input fields.
      • c) Modifying function ‘save_event($post_ID)’, accordingly to save added fields.
    2. 2. Modified ‘functions.php’ file, located at themes folder, instead of ‘functions-template’ (located at ‘plugins/events-maker/includes’ folder), to create the data output.
    3. 3. Modified ‘content-single-event.php’ located at themes folder:
      • a) Including the function added to ‘functions.php’ to show the page data output.

    But now my question is: Which function do I use to integrate new fields to polylang? (in order to echo the value of the label added to ‘events-maker-XX.po’)

    Thanks! :)

    P.S. If you wanna see what I need, check http://repsold.es/tempsdesalut/ca/events/event/quiromassatge-extensiu/ and in the right sidebar, under ‘Horarios’ and ‘Plazas’, you’ll see a couple of fields each, which actually remains in english… well I think I don’t need to make it that complicated, do I?
    … as it’s such little work, it could be done with a template for each language (content-single-event-es_ES.php, and content-single-event-ca), isn’t it?

    #4114
    Jordi Altimira
    Participant

    Nope, isn’t that easy as manage templates (thought I’d readed it somewhere), but tried with template file name endings in ‘-XX.php’ and ‘_XX.php’ and didn’t worked… :(

    #4115
    Bartosz
    Keymaster

    I hope you succeeded with your exams Jordi :)

    I’ll start with Polylang: you can use 2 functions icl_register_string() that comes from WPML compatibility or pll_register_string, purely Polylang function as described here (http://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/)

    But it has nothing to do with events-maker translation files. To make strings available for translation you’d need to follow this guidelines (http://codex.wordpress.org/I18n_for_WordPress_Developers) and make every new string wrapped with __, _e, _x etc. Then scan plugin files for the new strings, translate it and save (using Poedit for example).

    But. You shouldn’t have modified core plugin files, you know that? You could add new metaboxes in your theme functions.php file. Then create a function to handle the data output or just output this directly in your theme files.

    #4117
    Jordi Altimira
    Participant

    So do I… but as I almost couldn’t dedicate time to study… anyway, thanks! :)

    Yes I know I shouldn’t modify core functions, as obviously will be overwritten on every plugin update, but I didn’t know I could do it through ‘functions.php’ file at theme folder (tried to copy plugin files didn’t worked); so I’m doing it right now.

    And thanks for the polylang help, as I know it isn’t a matter you have to give support, I have taken advantage of you (not sure if it’s said this way…). I’m on it. Thanks again!

    #4118
    Bartosz
    Keymaster

    Of course you can – create a metabox to any post type (event in this case). Here’s the start: http://codex.wordpress.org/Function_Reference/add_meta_box

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.