Can this be done in settings pages

Support General Can this be done in settings pages

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33307
    dom@viewtolearn.co.uk[email protected]
    Participant

    Hi

    I have managed to setup a fairly complex settings page area for a site that I'm working on that will allow them to control all of the functionality that they require on the site in one place. I've used Custom HTML fields to provide some basic instructions in groups of fields but those instructions are just basic.

    I got to thinking about how this might be improved. Obviously I could create a custom post type (help) and add help articles to it. Conventionally though these would end up being diplayed on the front end, where in reality they would not be of much use. Ideally I'd like to display these in a seperate tab in my settings page.

    Is there a way to hook up mb views to show an MB custom post on an MB sttings page on the backend?

    Could you perhaps suggest another way that this might be done?

    Many thanks

    #33320
    Long NguyenLong Nguyen
    Moderator

    Hi Dom,

    If you want to show the post on the settings page, you also have to use the Custom HTML field to show it up. There is no actions or templates that support showing post on the settings page like that.

    #33323
    dom@viewtolearn.co.uk[email protected]
    Participant

    Hi

    Thanks for getting back to me.

    If I understand you correctly to achieve this I'd need to effectively take the post in raw html and then display that in a custom HTML field within a settings page.

    As I use Oxygen builder would it be possible to create a specific template to display 'Help' cpt posts and embed the html for that template in a custom HTML field on a settings page, which would then obviously display the correct help topics that the user requested?

    Many thanks

    #33333
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If Oxygen supports the shortcode template, you can create a custom callback function to display the shortcode.

    Field:

    array(
        'type' => 'custom_html',
        'std'  => '<div class="alert alert-warning">This is a custom HTML content</div>',
        'callback' => 'display_template',
    ),

    Callback:

    function display_template() {
        echo do_shortcode( '[template_shortcode]' );
    }
    #33335
    dom@viewtolearn.co.uk[email protected]
    Participant

    Thank you, I can see that that might well work, I'll give it a spin.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.