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

Allow wildcard includes in config.json to parse additional page json files #134

Open
siege9929 opened this issue Oct 26, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@siege9929
Copy link

Describe the new functionality

Allow includes in the config.json file so that we can create one json file per page. It's often easier for me to manually create pages via copying sections and editing a few variables, especially when I have an interface that includes common elements on every page like a row of nav buttons. If the config file allowed wildcard includes, I could copy a page json file, edit a few things, and have a new page with predefined tiles.

Additionally, it could be nice to add an option for a layout section of tiles that spans multiple pages, so I only have to set them up and edit them one time, instead of once per page. Again this would be nice for a nav bar or a header.

What will it look like in the Admin area?

No change

What will it look like on the dashboard?

No change.

@siege9929 siege9929 added the enhancement New feature or request label Oct 26, 2022
@github-actions
Copy link

Hey there, looks like this is your first time submitting a bug or enhancement to HACC! Thanks for helping make HACC a better app! 🎉

@qJake
Copy link
Owner

qJake commented Oct 26, 2022

Would you be able to provide a sample (JSON markup or similar) of what this would look like?

@siege9929
Copy link
Author

siege9929 commented Nov 24, 2022

Sure! Something like this.
In the main config.json, add a section to "pages" listing files or directories of files to include:

"pages": [
    {
        "files": [
            "./page1.json",
            "./data/page2.json"
        ],
        "directories": [
            "./page1/",
            "./data/page2/"
        ]
    },
    ... other pages below
]

Each of the files directly included or included in the directories would contain one or more sections that would normally be inside the "pages" section, so a file would look like this:

{
    "name": "default",
    "description": "Default Page",
    "isDefaultPage": true,
    "autoReturnSeconds": 0,
    "tiles": [
        {
            "name": "Tile",
            "sizeX": 2,
            "sizeY": 2,
            "type": "state"
        }
    ]
}

Spanning multiple pages is less important to me, but I suppose you could define a page section with a "span" key where you could list page names that it appears on.

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

No branches or pull requests

2 participants