Git Product home page Git Product logo

const's People

Contributors

lisps avatar mko24 avatar peterfromearth avatar splitbrain avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

const's Issues

Some way to use const from another page

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.

Plugin doesn't work at all

1st reason:
Line 220: if($ID != $this->page) return; is always true, since $this->page is always ''

2nd reason:
empty lines are thrown away and cause misaligned sections:
Line 83: $data = preg_split('/[\r\n]+/', $data, -1, PREG_SPLIT_NO_EMPTY); is the origin of this misbehaviour.

Why did you publish this really useless plugin?

Character < breaks it

Hi,

I was trying to use the plugin with the FontColor plugin. Couldn't do it because the < after the = in a var def breaks the entire code.

e.g.

<const>
var=<fc #ffff00>Yellow</fc>
</const>

Var Value: [%%var%%]

will break the page. If I remove the < char (obviously fc will stop working) works again.

Hope did help

const and cgkedit compatibility

Hi,
we are testing the const plugin and we notice that the CKGEdit plugin can´t manage the %% quotes for a given constant.
For example: myname=Bob Name: %%myname%%
Under DWEdit the output is Name: Bob - works like a charme :)

CKGEdit instead substitutes the %% with nowiki tags

Is there any way to wrap the constant and make it work with CKGEdit?

Cheers

Escape "=" sign in value

Doesn't seem to work if you have "=" in the value, for example you want to build a URL:

C_URL=https://some.query.url/search?q=

Then later in the document I have a reference like:

My URL = [[%%C_URL%%123456|123456]]

Or even an SQL plugin query like:

CONCAT('<a href="%%C_URL%%', reg.companyNumber, '">', reg.companyNumber, '</a>') AS companyNumber,

It doesn't resolve if the value contains "=", but if I take this out, it works.

I tried various methods to escape the "=" but it didn't work:

C_URL='https://some.query.url/search?q='
C_URL=https://some.query.url/search?q\=
C_URL=https://some.query.url/search?q\\=

C_URL=''https://some.query.url/search?q' . '=''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.