When creating a "New custom content" and using context keywords (eg %node:field-integer), the numeric integer field I'm adding gets pulled through with a comma (eg 7,234 instead of 7234).

The field in question does not have it's display formatted like that in Content Types > Manage Display either.

I've also tried %node:field-integer-raw and -unformatted, as well as %node:field-integer:raw and :unformatted, but neither of those worked.


merlinofchaos’s picture

Status: Active » Closed (won't fix)

Those tokens are provided by core and Panels just utilizes them. Actually, CTools does.

I don't think there's anything I can do. In theory a -raw version of the token should do the job but I don't really now. Have you tried token.module? It might add more tokens?

adamskinner’s picture

I was thinking that might have been the case. I have token.module, and even backported some changes to fields/number.module to D7 in hopes that it might get resolved. Unfortunately, the issue still persists.

As a workaround, I created a view and used tokens inside of it to generate the output I wanted (creating a list of links to external sites based on numeric identifiers in the url). I'll have to look into adding an appropriate token to number.module, or perhaps figuring out why it's adding this comma in the first place.

merlinofchaos’s picture

What about %node:field-integer:first -- you'll need a pretty recent version of CTools, I recall fixing a bug with that : a few weeks ago.

kholloway’s picture

I'm not sure if you are still having problems with this or hit the same wall but figured out a way around this.

Basically there is a Display Mode on each content type for Tokens that can be used to control exactly what is rendered by tokens that are used.

To enable it per content type, do the following:

- In the actual Content Type itself, got to the "Manage Display" tab.
- Scroll down to the end of the field listing and click the "Custom Display Settings" link.
- Enable (Check) and Save the Token option to enable the Token Display mode.
- Go to that display mode (Grey display mode tabs near the top) and any field settings you do here effect what the tokens render (which is the same ones Panels uses).

Hope this helps. Nice way to avoid resorting to custom panel code or Display Suite (:

dropfen’s picture

The same problem, but with date formats. Need a short-formatted DateString of %node:changed.
Actually not possible to use %node:changed:short.