I've been trying to make sense of Tamper module and associated plugins and can't get it to do several (seemingly) simple tasks:

  • Rewriting a target to combine the values of several sources.
  • Reuse a source in more than one target field and format each differently.

It seems like one would want to create one tamper for each target (rather than source) since defining content and format of the output is our ultimate objective. Is it possible to assign tamper output to a particular node field not identified with a source? It seems not.

Since we can only define utilize target fields by assigning a source to it in the mapping, it would seem we're forced to reuse source fields or include fake (blank) ones. But then the tamper rules are grouped according to source, regardless of whether that source is destined for different targets. So consequently one can not re-format the source data for different, distinct purposes in the target fields.

Please tell me I've missed something basic...

Comments

Lynnwood’s picture

Issue summary: View changes

minor edits

Lynnwood’s picture

Status: Active » Closed (works as designed)

Reporting back that I have figured out ways to accomplish what I outlined above. Here's a few notes on what I did that may be helpful to others:

  • Since one can only specify target fields for which a source field is provided, if you want additional targets not included in the source data (e.g. for fields in the created node that don't exist in the source data), you have to include it as a source field, even if it's empty.
  • If you want to rework a source field in more than one way (via one or more plugins) to be used in different targets, you need to create duplicate source fields, one for each desired output format.
  • The rewrite plugin does work as described, however, you just need to keep in mind the previous two points. For example, if you want to reuse content from one field using rewrite, but also want it in a different format, you'll need to define a separate source field to apply the different formatting.
  • Also, you can not take a source and reformat it via plugins and then also use Rewrite referencing the same source. Rewrite will use the source in it's original form rather than the reformatted version. Consequently, you need to define one source to reference for reformatting and then define a separate source to be used for the Rewrite target.
  • Just to clarify (at least for myself) "Copy Souce Value" only overwrites the source specified. It's not necessary for using Rewrite and it can't be used to rework one source with different formats.

While it seems to me that the Tamper module could be designed to make this kind of use-case easier and more intuitive, I did figure out how to do it so I'll close this issue.

Lynnwood’s picture

Issue summary: View changes

another correction.

liquidcms’s picture

Issue summary: View changes
Status: Closed (works as designed) » Active

Also, you can not take a source and reformat it via plugins and then also use Rewrite referencing the same source. Rewrite will use the source in it's original form rather than the reformatted version.

not completely sure this is correct. isn't it, sadly, the other way around?

at least the PHP plugin is opposite to this. if you reformat a source and then also have a php formatter on a different source but that uses that original source; only the reformatted source (i.e. the target) is available. the original source is no longer available to use as a token.

i think the copy source could be used to compensate for this; but as yet i have not figured it out.

and yes, i agree, the logic for some of how this works seems backwards and therefore much more confusing that it should be.

gaele’s picture

Status: Active » Closed (fixed)