WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
[resolved] Show Dropdown made in CCTM in frontend (2 posts)

  1. Karun
    Member
    Posted 1 year ago #

    Hi,

    I've been using CCTM for sometime now and this is a great plugin which has various facilities for making custom fields easy to make and use.

    I just have one question. Is it possible to bring the dropdown select box made inside the CCTM to be displayed in the frontend?

    How to show the the dropdown list in the frontend?

    Thanks :)

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    With 0.9.7.1 (see the dev branch), you can create entire forms on the front-end: https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=132
    https://code.google.com/p/wordpress-custom-content-type-manager/wiki/cctm_post_form

    If you want to create just a single dropdown, that would take some custom development -- I'd recommend that you review the source code to see how it draws its forms. In particular the includes/StandardizedCustomFields.php class and also the CCTM.php's cctm_post_form function.

    E.g. study this:

    $FieldObj = CCTM::load_object('text','fields');
    $post_title_def = array(
    	'label' => 'My Field',
    	'name' => 'my_field',
    	'default_value' => ''
    	'extra' => '',
    	'class' => '',
    	'description' => '',
    	'validator' => '',
    	'output_filter' => '',
    	'type' => 'text'
    );
    $FieldObj->set_props($def);
    
    print $FieldObj->get_create_field_instance();

    Each type of field has its own properties you'd have to set and pass as arguments to the set_props() function -- see the Dropdown PHP class inside of the fields folder.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic