http://lab41.co/appointments/ 1) For the top table how do

Hi

http://lab41.co/appointments/

1) For the top table how do I center all the entries?
[app_my_appointments allow_cancel="1"]

2) I want to have an appointment manager page where a secretary (site editor role) or somebody can edit and see all appointments.
a) [app_all_appointments] - how do I center all entries on this table as well?
b) How do I include any notes or extras about the appointment in this page? I.e. any of the custom fields that were filled out by the client when they setup the appointment?

Regards

Alex

  • Jack Kitterhing
    • Code Norris

    Hi Alex,

    I hope you are well today.

    1: Use this css class

    .appointments-my-appointments table td

    Add that with a padding-left: 20px;

    so

    .appointments-my-appointments table td {
         padding-left: 20px;
    }

    Change the px value as required :slight_smile:

    2: Which page is that? Could you link me to it please? :slight_smile:

    B), The notes should output on that as far as I'm aware, I'll include the lead developer @Vladislav

    Thanks!

    Kind Regards
    Jack

  • Alexander
    • Design Lord, Child of Thor

    1) Where do I place this css? Under the field "Additional css Rules"
    2) http://lab41.co/appointments/appointment-manager/
    a) You see "Reserved by GCal" really adds no value! Think of a secretary managing multiple diaries? She needs to know which appointment has more priority and here she can't see what it's for.
    b) Would be nice to be able to add extra columns with custom field data. E.g. cell number, or notes, etc.

  • Vladislav
    • Dead Eye Dev

    Hello,

    You can manipulate the shortcode output and add the note field to the output table with a bit of custom code. This bit of code should do the job:

    function my_app_add_column ($cols) {
    	return $cols . "<th>Note</th>";
    }
    add_filter('app_all_appointments_column_name', 'my_app_add_column');
    function my_app_add_note ($str, $app) {
    	return $str . "<td>{$app->note}</td>";
    }
    add_filter('app-shortcode-all_appointments-after_status', 'my_app_add_note', 10, 2);

    The first filter will add a column header, while the second one will actually inject the note field values into the table.

  • Alexander
    • Design Lord, Child of Thor

    Hi Jack

    1) Could I put the CSS into the theme custom CSS as well?
    2) Seems tricky. Is there anyway you could add this to the plugin files so on next plugin update it's easier to do this? I wish they could add a feature that allows you to choose the fields to display here!
    a) Does it replace the "Reserved by GCal" with the note?
    b) IF I want another field showing all I add is "{$app->note}"? and change name to fieldname?
    c) When my theme update does functions.php also get overwritten?
    d) When you mean seperate plugin, what do you mean here?
    3) What is this box for in the plugin settings?
    "Additional css Rules"? Why can't I put your CSS edits in there?

  • Jack Kitterhing
    • Code Norris

    Hi there @Alexander

    1) Yep, you certainly can :slight_smile:

    2) I'll see what @Vladislav says on this :slight_smile:

    a) Hmm, not that I know of, I think @Vladislav was referring to the shortcode output, correct Ve? :slight_smile:

    b), Correct, you just change the name to fieldname.

    c) the function.php does, yes.

    d), you can add the code as it's own plugin, then activate that, i.e,

    <?php
    /**
     * Plugin Name: Name Of The Plugin
     * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
     * Description: A brief description of the Plugin.
     * Version: The Plugin's Version Number, e.g.: 1.0
     * Author: Name Of The Plugin Author
     * Author URI: http://URI_Of_The_Plugin_Author
     * License: A "Slug" license name e.g. GPL2
     */
    
    function my_app_add_column ($cols) {
    	return $cols . "<th>Note</th>";
    }
    add_filter('app_all_appointments_column_name', 'my_app_add_column');
    function my_app_add_note ($str, $app) {
    	return $str . "<td>{$app->note}</td>";
    }
    add_filter('app-shortcode-all_appointments-after_status', 'my_app_add_note', 10, 2);

    3: Yes you can also add the CSS there :slight_smile: But I'd still personally recommend the CSS plugin :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Vladislav
    • Dead Eye Dev

    Hello,

    As for allowing for field selection in the output by making use of the shortcode arguments, that's definitely a good idea. I'll see what can be done about this in a future plugin release.

    As for now, you can use the code above. Please, note that the code is actually in two equally important parts - the first part adds the table column, the other one adds the actual field output. So, in order to get more then one field in there, you'll need to add them both - since both filters are strings you can just append to them, e.g. like this:

    unction my_app_add_column ($cols) {
    	return $cols . "<th>Note</th><th>Phone</th>";
    }
    add_filter('app_all_appointments_column_name', 'my_app_add_column');
    function my_app_add_note ($str, $app) {
    	return $str . "<td>{$app->note}</td><td>{$app->phone}</td>";
    }
    add_filter('app-shortcode-all_appointments-after_status', 'my_app_add_note', 10, 2);

    This should add both note and phone fields. Also, this won't affect the GCal field.

    As for your theme's functions.php being overwritten with the theme update - yes, that is a concern. However, if you plan on making any kind of changes to your theme or making use of functions.php for your own purposes, your best choice would be to simply use a child theme based on your current one. That way, you get to keep your theme pristine and update-ready and still have your customizations. Of course, for the type of modifications in this post (PHP code) you can also always use the mu-plugins approach instead. I hope this helps.

  • Alexander
    • Design Lord, Child of Thor

    Hi

    How do I just center the table using CSS in the specific plugin CSS setting field? (I was referring to the table alignment issue rather than adding the extra data into the table)

    3) I tried this and it didn't work. :slight_frown: It just changed the font size of the table.

  • PC
    • WPMU DEV Initiate

    hey there

    Thanks for your post. @Jack Kitterhing asked me to look at this.

    http://lab41.co/appointments/my-appointments/ is a 404

    http://lab41.co/appointments/ : Appears fine to me. Can you kindly check with browser cache cleared ?

    http://lab41.co/appointments/my-appointments/

    .appointments-all-appointments table th, .appointments-all-appointments table td {text-align : center} should fix it.

    Screenshot :

    Please advise.

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.