• Resolved visioncreativewilson

    (@visioncreativewilson)


    Hi,

    I am using the CCTM to make custom posts (which rocks!), but how can I output the [summarize-posts] and put them into a dropdown array instead of a list? I can’t figure it out!

    Please help

Viewing 6 replies - 1 through 6 (of 6 total)
  • The shortcode formatting is customizable. See https://code.google.com/p/wordpress-custom-content-type-manager/wiki/summarize_posts_shortcode

    For example:

    <select>
    [summarize_posts]<option value="[+ID+]">[+post_title+]</option>[/summarize_posts]
    </select>

    Note that you will have much more freedom here if you use the PHP equivalent to the shortcode.

    Thread Starter visioncreativewilson

    (@visioncreativewilson)

    Thanks! I ended up using the [summarize] because I suck at PHP, but I’ll try to read up on it.

    Glad it worked. I guess it depends on what you need to do with the option — summarize posts isn’t really intended as a form-generation tool, so I’m not sure it helps you once you need to do something with the form you’ve created. There is the cctm_post_form shortcode used to generate a post-generation form: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/cctm_post_form — it would allow users to submit their own posts.

    Thread Starter visioncreativewilson

    (@visioncreativewilson)

    I have a bit of a follow-up question:

    How would I write that drop down in PHP? And can I make it limited?

    I’m trying to pull <?php the_content()?> into a list

    right now, I’m trying something along the lines of this:

    <select id="<?php echo $this->get_field_id('posttype'); ?>" name="<?php echo $this->get_field_name('posttype'); ?>" class="widefat" style="width:100%;">
        <option <?php selected( $instance['posttype'], 'Option 1'); ?> value="Option 1">Option 1</option>
        <option <?php selected( $instance['posttype'], 'Option 2'); ?> value="Option 2">Option 2</option>
        <option <?php selected( $instance['posttype'], 'Option 3'); ?> value="Option 3">Option 3</option>
    </select>

    Sorry, I’m brand new to php

    That’s a bit beyond the scope of what I can advise you with, unfortunately. It’s probably an uphill battle trying to wrestle anything in the_conent() into something specific since WP filters it in several places already and there’s no guarantee what shape the value will be in by the time it gets to you. WP also has the bad habit of PRINTING output instead of RETURNING it, making it quite difficult to do any further modifications with it. If you need the content in a list, the best way to do it is to create the content as a list when you create/edit the post/page.

    I get flamed all the time by saying stuff like this, but if you want to learn PHP, I would recommend that you do not look to WP as a model of how to code. It may get your feet wet, but its architecture is often structured on some very bad patterns that are best avoided by the serious developer.

    Thread Starter visioncreativewilson

    (@visioncreativewilson)

    I think I am just over complicating things by over thinking them; or I am not communicating things correctly. Either way, I really appreciate the support you’re providing!

    All I really want to do is make a drop down where the values are populated by the custom taxonomy and make them active when someone selects them (with no javascript button)

    Either way, I will make a donation as thanks for all the help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘make a dropdown list from the [summarize-post]’ is closed to new replies.