Skip to content

Some way to use const from another page #3

@iainhallam

Description

@iainhallam

I'd like to define a constant on a single page on my DW, then be able to reference it from other pages to do calculations. This way, we'd only ever have to set some values in a single place, and have them work for several pages.

One way to do this would be to work with the output from the include plugin - at the top of the page you'd include a section or page, which would contain the const section. This assumes that you could have other const sections on the page and they'd just get concatenated.

Alternatively, the plugin could implement looking at another page itself, but it seems sensible to use the existing functionality of include and contribute any fixes needed.

My use case in more detail:

We have a fee for membership, and several things around the site are set in terms of that - for instance 2x monthly fee, 50% of monthly fee, and it's a pain to have to go around the site updating them all when the base fee changes. With consts across pages, we could just update a single place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions