theboxer / Git-Package-Management

MODX extra for building and managing external packages.
39 stars 29 forks source link

[Question] Is it possible to put TV's in a subcategory, or different category? #47

Closed hugopeek closed 9 years ago

hugopeek commented 9 years ago

I often create subcategories to divide TV's into multiple tabs under a Resource. This way, the structure is more descriptive for the client, and tabs never contain too many TV's.

theboxer commented 9 years ago

Yes you can create more categories and put elements into them. However, all those subcategories will be created under the major category (with a name of the package), to avoid conflicts.

Sorry, it's not documented yet how to do it, but here you have a sample how to do it:

"snippets": [{
    "name": "UrlShortener",
    "category": "Under Under"
}],
"categories": [{
    "name": "Under"                
},{
    "name": "Under Under",
    "parent": "Under"                
}]
hugopeek commented 9 years ago

Hi @TheBoxer, sorry for the late reply, and thanks for the explanation!

It works for me when using it for Chunks, but doesn't seem to do anything in combination with TV's..

This is my config.json:

{
    "name": "FormBlocks",
    "lowCaseName": "formblocks",
    "description": "FormBlocks lets you create your own forms in MODX. It uses ContentBlocks to add the various fields you need and a slightly modified FormIt version to validate and submit the forms.",
    "author": "Hugo Peek",
    "version": "0.2.0",

    "package": {
        "elements": {
            "chunks": [
                {
                    "name": "formBlocksAutoresponder"
                },{
                    "name": "formBlocksContentBlock"
                },{
                    "name": "formBlocksEmail"
                },{
                    "name": "formBlocksEmailRow"
                },{
                    "name": "formBlocksTextfield"
                },{
                    "name": "formBlocksTextarea"
                },{
                    "name": "formBlocksSelectBox"
                },{
                    "name": "formBlocksSelectBoxRow"
                },{
                    "name": "formBlocksSelectOption"
                },{
                    "name": "formBlocksSelectOptionRow"
                },{
                    "name": "cbFormBlocksLayoutFieldset",
                    "category": "ContentBlocks"
                }
            ],

            "snippets": [
                {
                    "name": "formBlocksEmail"
                }
            ],

            "plugins": [
                {
                    "name": "formBlocksLexiconMgr",
                    "events": ["OnDocFormRender"]
                }
            ],

            "templates": [
                {
                    "name": "Form"
                }
            ],

            "tvs": [
                {
                    "caption": "formblocks.tv.form_email_to.name",
                    "name": "form_email_to",
                    "category": "Instellingen",
                    "sortOrder": "1",
                    "description": "formblocks.tv.form_email_to.description",
                    "type": "email",
                    "templates": ["Form"]
                },{
                    "caption": "Onderwerp van e-mail",
                    "name": "form_email_subject",
                    "category": "Algemeen",
                    "sortOrder": "2",
                    "description": "Je kan hier placeholders gebruiken van velden in het formulier (bijvoorbeeld: Reactie van [[+form_name]]).",
                    "type": "text",
                    "templates": ["Form"]
                },{
                    "caption": "Redirect pagina",
                    "name": "form_redirect",
                    "category": "Instellingen",
                    "sortOrder": "90",
                    "description": "Vul hier het ID in van de gewenste bedanktpagina, of sleep de pagina vanuit het menu dit invoerveld in.",
                    "type": "number",
                    "templates": ["Form"]
                },{
                    "caption": "Tekst in verzendknop",
                    "name": "form_submit_button",
                    "category": "Algemeen",
                    "sortOrder": "92",
                    "type": "text",
                    "templates": ["Form"]
                },{
                    "caption": "Layout van formulier",
                    "name": "form_layout",
                    "category": "Instellingen",
                    "sortOrder": "5",
                    "description": "Standaard staan alle velden en labels onder elkaar, bij Inline staan de velden en labels naast elkaar (alleen geschikt voor kleine formulieren dus) en bij Horizontaal staan de labels naast de velden.",
                    "type": "listbox",
                    "inputOptionValues": "Standaard layout==form-default||Horizontaal formulier==form-horizontal||Inline formulier==form-inline",
                    "defaultValue": "form-horizontal",
                    "templates": ["Form"]
                }
            ],

            "categories": [
                {
                    "name": "Algemeen"
                },{
                    "name": "Instellingen"
                },{
                    "name": "ContentBlocks"
                }
            ]
        },

        "systemSettings": []
    },

    "extensionPackage": {}
}

(As you can see I also tried to use lexicon strings for TV captions, but that doesn't fly.. I'm wondering if this is possible at all now actually in MODX.. Do you know that?)

bartholomej commented 9 years ago

Confirm. Should be fixed here cf1e708 @hugopeek Fetch and try again, please.

hugopeek commented 9 years ago

Yes, fixed. Thanks :+1: