Exchanging data
If you need to pass information from one injection to another, inside the same content and priority, you can use the ´intra´ property, which gets reinitialized at the start of each new content processing.
If you need to pass information from one injection to another, outside the same content or priority, you can use the ´extra´ property, which gets initialized at creation time of the Nzymes engine.
Example.
This text is part of the WordPress Sample Page.
Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)
To highlight some part of the text, you could do it like this:
Hi there! {[ .start() ]}I’m a bike messenger by day{[ .end() | .funny(1) ]}, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)
The ´start´, ´end´, and ´funny´, custom fields could contain:
Name | Value |
---|---|
start |
|
end |
|
funny |
|
Here is what you’d get:
Hi there! I‘m a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)
The interesting thing is that those injections are now working exactly like HTML tags, meaning that they are completely portable. You can move them around in that content or copy and paste them into another one, and they continue to work without having to change anything.
Hi there! {[ .start() ]}I’m a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas.{[ .end() | .funny(1) ]} (And gettin’ caught in the rain.)
The content above will be shown like:
Hi there! I‘m a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)
|
|
Nzymes | WordPress Plugin |
© 2015 by Andrea Ercolino |