We are trying to add the node type into the Ad Unit pattern but none of the node tokens seem to be being rewritten.
We want to use "[node:content-type:machine-name]", to produce something like:
googletag.defineSlot("/6831/LN_newlawjournal/countdown", [728, 90], "dfp-ad-nlj_lb")
But we are getting:
googletag.defineSlot("/6831/LN_newlawjournal/[node:content-type:machine-name]", [728, 90], "dfp-ad-nlj_lb")
As you can see the node tokens are converted fine in the targeting and global settings.


| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 1895522.patch | 1.58 KB | bleen |
| #5 | 1895522.patch | 4.55 KB | bleen |
| #1 | dfp-tokens.patch | 2.03 KB | bleen |
| dfp_2.png | 59.4 KB | soulston | |
| dfp_1.png | 144.22 KB | soulston |
Comments
Comment #1
bleen commentedThis one was pretty straight forward ... I was not passing "node" to the token replace used by ad_unit
Comment #2
bleen commentedI went ahead and committed this
Comment #3
soulston commentedThanks - confirmed this is working
Comment #4
soulston commentedSorry to be a total pita but it might be good to expose these in the UI. I am guessing this needs:
dfp_ctools_export_ui.inc
to
Would these types be better placed in a global array or something so that they are more easily edited etc?
I'll create a patch once you have updated the repo again.
Comment #5
bleen commentedhow bout this
Comment #6
soulston commentedThis works for me - thanks
Comment #7
bleen commentedawesome ... committed
Comment #8
davidfells81@gmail.com commentedShould also pass array('clean' => TRUE) to the token_replace function - without that I still end up with empty tags in some circumstances (for example, a [term:name] target on a unit that also appears on a node/% page)
Comment #9
bleen commentedAn excellent suggestion ... though it should really be array('sanitize' => TRUE)
... in the future please open a new bug/feature request
Comment #10
bleen commentedoops .. forgot patch
Comment #11
bleen commentedcommitted the patch from #11