Appointments+ deletes text service description page

Help!! I'm about ready to pull my hair out! I'm trying to do the simplest of tasks ... created pages that Appt.+ can use as descriptions for when the drop-down for services is selected.

It works in one instance ... and even bleeds over to a read more for additional text.

BUT, if I make any change to that text it disappears forever!

-- Is there some special coding required so Appt.+ recognizes the text?

-- Is there a length limit?

-- Are there shortcodes I can't use on a page?

If anyone can point me to documentation that answers these questions I'd be much obliged.

george

  • Michael Bissett

    Hey @Coach George,

    -- Is there some special coding required so Appt.+ recognizes the text?

    -- Is there a length limit?

    Nope, and nope, but it's definitely odd that you're having the description disappear like this...

    I tried reproducing this on my own test site, and I wasn't able to reproduce what you've got going on. Have you already tried doing a conflict test here, as laid out in the flowchart at the bottom of our Getting Support page:

    https://premium.wpmudev.org/manuals/getting-support/

    And seeing if that helps? The test site I have this working properly on is set up like this:

    WordPress version: 4.2.2
    Plugins active: Appointments+, WPMU DEV Dashboard
    Theme active: Twenty Fourteen

    If it doesn't, then could you please mention the service where you had the description disappear, and enable Support Access to your site?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Kind Regards,
    Michael

    • Coach George

      Hi Michael,

      Thank you VERY much for your prompt reply. I wasn't aware of the flowchart you shared but can use it in the future. I DID NOT go through with the process this time around as I was able to get the item to function with simple pages that contained only text and other simple elements one can access

      I sense what I'm lacking is a basic understanding of what I can and cannot do with the plugin. Can you point me to to any documentation for the program? I've watched all the YouTube videos for it -- which were quite good!

      What control do I have over the styling of the text in dropdown?
      — Specifically, can I cause it to be shorter? Or the text to be of different colors/boldness?

      What elements can I put in target page? What elements are restricted?
      — Fancy Title gets rejected.
      — It seems to disappear the text in the dropdown if I use any Jupiter shortcode ... if I insert "Image" or any other.
      — It doesn't seem to matter where I put the element. At the beginning or the end.
      — After I've added it and the dropdown fails I can't just delete the element; I have to browse back to a prior version and reset the page or start over with a new page.

      I sent you a couple of screenshots of the page with the dropdown and the target page details. Hopefully these details will cause you more success as you attempt to make the error show up on your side.

      George

  • Michael Bissett

    Hey @Coach George,

    Okay, so we're working with Visual Composer here, wasn't aware of that factor before.

    Can you point me to to any documentation for the program? I've watched all the YouTube videos for it -- which were quite good!

    We've got the usage page over here:

    https://premium.wpmudev.org/project/appointments-plus/#product-usage

    Plus, inside the plugin itself, there's inline documentation for the various parts of the plugin. :slight_smile:

    What elements can I put in target page? What elements are restricted?
    — Fancy Title gets rejected.
    — It seems to disappear the text in the dropdown if I use any Jupiter shortcode ... if I insert "Image" or any other.
    — It doesn't seem to matter where I put the element. At the beginning or the end.
    — After I've added it and the dropdown fails I can't just delete the element; I have to browse back to a prior version and reset the page or start over with a new page.

    Not sure what you mean by "Fancy Title", could you elaborate please?

    Also, regarding the issues with elements being displayed... what if you were to add the "description" paramter to the [app_services] shortcode, like this:

    [app_services description="content"]

    Please advise,
    Michael

  • Coach George

    Thanks for getting back to me so promptly Michael.

    ... so yeah, I was using Visual Composer. Should this work or am I left using shortcodes? Any time I use V.C. --- i.e. to create a "fancy title" it kills the linking process. Nothing shows up in the drop-down. I found a partial work-around by using shortcodes while in Classic Mode but it would be nicer to be able to use V.C. since it's more intuitive.

    Can I trick the system by creating everything in V.C. on a sample page then cut/paste it into text of target page?

    Thanks for the link to the documentation.

    I've read it all and watched the videos but they don't seem to address this issue in as deep detail as I require.

    Is there inline info at this detail I overlooked?

    Also, regarding the issues with elements being displayed... what if you were to add the "description" paramter to the [app_services] shortcode, like this:

    [app_services description="content"]

    Can you advise me on how this works and for what purpose? I"m only vaguely familiar with using shortcodes inside Appointments+ I've consistently had problems with the design showing up as I'd like.

    George

  • Michael Bissett

    Hey @Coach George,

    I would need to have a look on your site here, as I don't presently have a copy of Visual Composer of my own to work with, I will say that we may very well need to take the classic route though.

    Could you please enable Support Access to your site, so that I can dig into this further? :slight_smile:

    Kind Regards,
    Michael

    P.S. Regarding this:

    Also, regarding the issues with elements being displayed... what if you were to add the "description" paramter to the [app_services] shortcode, like this:
    [app_services description="content"]

    The reason why we'd be looking to use the "content" parameter is because by default, it's set to "excerpt", which strips out the shortcodes embedded in the content.

  • Coach George

    You have access my friend.... thank you. The best page to see a big mess that tests all the elements is http://www.twogethercoaching.com/wp-admin/post.php?post=7373&action=edit You get there by going to:

    http://www.twogethercoaching.com/book-now/ and clicking the Individual Coaching Intensive.

    When this is perfected I'd like to let them set an appointment at least 1 of 2 ways:

    #1 This click down to the service, it auto-displays on the calendar and they select a time.
    #2 They click on the more information ---> link to be taken to a group page i.e.

    "Coaching Intensive Programs"

    or "Coaching Events"

    or "Coaching-By-Text" programs

    On each of these pages will be info then a pricing table comparing the programs.

    At the bottom on each column will be a "Book Now" button that if clicked will take them only to the appointments page for that single service What they'd see is a calendar with only the available times/days for that specific service.

    Is that possible to do all that?

    Thanks for explaining the 'excerpt' category I think I get it.

    If we don't connect again today I hope you have a lovely weekend!"

    George

  • Michael Bissett

    Hey @Coach George,

    After doing a good deal of digging into the excerpt side of things, I think I've got a solution for that.

    If you were to insert the following code as a mu-plugin (more on how to do that here):

    <?php
    
    add_action('init', 'my_custom_init');
    function my_custom_init() {
    	add_post_type_support( 'page', 'excerpt' );
    }
    
    function get_custom_excerpt( $excerpt, $page_id, $worker_id=0 ) {
        $text = '';
        if ( !$page_id )
            return $text;
        $page = get_post( $page_id );
        if ( !$page )
            return $text;
    
        $thumb = preg_match('/<img[^>]+\>/i', $excerpt , $matches) ? $matches[0]: '';
        $text = $page->post_excerpt;
    
        $text = apply_filters('app_the_content', $text, $page_id, $worker_id );
        $text = str_replace(']]>', ']]>', $text);
        $excerpt_length = apply_filters('app_excerpt_length', 20);
        $excerpt_more = apply_filters('app_excerpt_more', ' &hellip; <a href="'. esc_url( get_permalink($page->ID) ) . '" target="_blank">' . __( 'More information <span class="meta-nav">&rarr;</span>', 'appointments' ) . '</a>');
    
        if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
            $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
            preg_match_all( '/./u', $text, $words_array );
            $words_array = array_slice( $words_array[0], 0, $excerpt_length + 1 );
            $sep = '';
        } else {
            $words_array = preg_split( "/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY );
            $sep = ' ';
        }
        if ( count( $words_array ) > $excerpt_length ) {
            array_pop( $words_array );
            $text = implode( $sep, $words_array );
            $text = $text . $excerpt_more;
        } else {
            $text = implode( $sep, $words_array );
        }
    
        $custom_excerpt = $thumb . $text;
    
        return $custom_excerpt;
    }
    
    add_filter( 'app_excerpt', 'get_custom_excerpt', 20, 3 );

    You should then be able to add in an excerpt separately from the "Excerpt" metabox that shows up inside the "Edit Page" screen (you may need to enable the metabox from the "Screen Options" button at the top right of the page), inserting the shortcodes as necessary.

    Please bear in mind though, that as we're disabling the stripping of the shortcodes, you'll need to be careful where the shortcodes are being placed, as it's possible that a shortcode would be cut halfway through. We can adjust the length of the excerpt, .

    Let me know if this helps please! :slight_smile:

    Kind Regards,
    Michael

    P.S. If that code I provided initially doesn't render a shortcode, you may need to insert this code as well:

    add_filter('app_excerpt', 'do_shortcode');

    P.P.S. Regarding this:

    At the bottom on each column will be a "Book Now" button that if clicked will take them only to the appointments page for that single service What they'd see is a calendar with only the available times/days for that specific service.

    Using the "Individual Coaching Intensive" service as an example, if you wanted a "Book Now" button that'd point directly to that particular service, you'd want to have the button go to this link:

    http://www.twogethercoaching.com/book-now/?app_service_id=6

    That'd be how you would link to a specific service. :slight_smile:

  • Michael Bissett

    Hey @Coach George,

    The code that'd be dealing with this would be in lines 1301-1303 of:

    /appointments/appointments.php

    $excerpt_length = apply_filters('app_excerpt_length', 55);
    		$excerpt_more = apply_filters('app_excerpt_more', ' &hellip; <a href="'. esc_url( get_permalink($page->ID) ) . '" target="_blank">' . __( 'More information <span class="meta-nav">&rarr;</span>', 'appointments' ) . '</a>');
    		$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );

    In this case, it's set to choose an excerpt from the first 55 words in a page. The "I" in a sentence doesn't count as a word in WordPress's opinion, so in case you were curious as to why the excerpt in the "Solo Master Coaching" excerpt would come out to 57 words in something like this:

    http://www.wordcounter.net/

    Just be sure to bear that in mind. :slight_smile:

    Hope this helps!

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.