Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a sample settings and metabox script? #97

Open
dougcassidy opened this issue Oct 29, 2014 · 10 comments
Open

Is there a sample settings and metabox script? #97

dougcassidy opened this issue Oct 29, 2014 · 10 comments

Comments

@dougcassidy
Copy link

I'm looking for a sample script that shows how to set up the settings, metaboxes, etc. I'm a little stumped. I have the framework included, as a library. Is there a settings array that i need to filter? do I set up a new framework object?

@padalec
Copy link

padalec commented Oct 29, 2014

@dougcassidy
Copy link
Author

Of course. We have code like
'fields' => array(
array(
'type' => 'toggle',
'name' => 'tg_1',
'label' => __('Toggle', 'vp_textdomain'),
'description' => __('Suits the need to ask user a yes or no option.', 'vp_textdomain'),
'default' => '1',
),
)
but no clue where to put that code?

@padalec
Copy link

padalec commented Oct 29, 2014

Do you know how to create theme in WP?

@dougcassidy
Copy link
Author

Yes. You do not say in your documentation how to use the the small snippets of code. I can not find any full example code.

is it like alchemy?
$custom_metabox = new WPAlchemy_MetaBox(array(
'id' => '_custom_meta',
'title' => 'My Custom Meta',
'template' => STYLESHEETPATH . '/custom/meta.php'
));

@padalec
Copy link

padalec commented Oct 30, 2014

Look this http://vafpress.com/documentation/vafpress-framework/metabox/builder.html
and try this code in your function.php file:

require PATH_TO_VFPRESS.'/vfpress/bootstrap.php';
function my_init_metaboxes()
{
    $meta_box = array(
        array(
            'name'          => 'field_name',
            'type'          => 'textbox',
            'label'         => __('Title'),
        )
    );
    $data = array(
        'id'          => 'uniqe_id',
        'types'       => array('post_types_list'),
        'title'       => __('Title'),
        'priority'    => 'normal',
        'is_dev_mode' => false,
        'template'    => $meta_box,
    );
    $VP = new VP_Metabox($data);
}
// the safest hook to use, since Vafpress Framework may exists in Theme or Plugin
add_action( 'after_setup_theme', 'my_init_metaboxes' );    

it was not tested (errors may occur).

Regards

@dougcassidy
Copy link
Author

Ah, ok, this is closer to what I am looking for. Thank you. Although, I did not think to look in the 'builder' sections. What I would really like to see are the scripts used to set up your demo site. If I had those scripts, I could easily build anything from your framework, just by copying your scripts. I have evaluated several frameworks, in the last week or so, and all of them had demo scripts that showed how to use every type of option/metabox/filed.

@padalec
Copy link

padalec commented Oct 30, 2014

Hi,
this is not my framework I'm just a user who uses it :). Somewhere on github exists demo version for download or try search this forum http://support.vafpress.com/forum/vafpress-framework/helps/

@dougcassidy
Copy link
Author

For those searching, this appears to be it https://github.com/vafour/vafpress-framework-theme-boilerplate

@padalec
Copy link

padalec commented Nov 4, 2014

great this is it! :)

@Zackio
Copy link

Zackio commented Nov 7, 2014

I wish I knew that existed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants