Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am not sure the exact use cases here, but opening an issue to see what kinds of tokens might be helpful for people. Merlinofchaos had mentioned a title token here #1605284: The following token types are not defined but have tokens which seems good, but what else and does anyone love writing .token.inc files?
Comment | File | Size | Author |
---|---|---|---|
#4 | fpp_entity.zip | 8.14 KB | magicmyth |
#3 | 1798482-fppanes-entity-api-integration-3.patch | 2.71 KB | magicmyth |
Comments
Comment #1
heylookalive CreditAttribution: heylookalive commentedIf you require tokens for FPP you can just enable the entity_tokens module that comes with entity api.
Comment #2
BarisW CreditAttribution: BarisW commentedI've tried enabling the Entity Tokens module but I don't get new tokens for Fieldable Panel Panes.
I try to use the 'path' value in my view mode. I'd expect it to be [fieldable_panels_pane:path] but that does not work.
Any thoughts?
Comment #3
magicmyth CreditAttribution: magicmyth commentedAs the Fieldable Panels Pane entity does not expose any tokens for its properties (fields are automatically exposed). I've created a companion module that integrates the FPPane entity with Entity API. This means if Entity Token is enabled then the Title, Path, and ID properties are available as tokens.
More importantly for me this will expose the entities properties as contextual arguments for Views' Pane display.
Why make it a sub-module?
Though it is easy enough to add this directly to the main module itself. Not everyone may want this feature. Thus this avoids bloating up the main module with functions that many sites will not use. Plus, even though the current integration is quite simple. Further Entity API integration could be added without further bloating the main module.
Its worth noting this might pare up well with [#8485101].
I will also attach this sub-module as a standalone ZIP for anyone to use as not everyone knows GIT FOO! ;)
Comment #4
magicmyth CreditAttribution: magicmyth commentedAs promised the standalone module. Just extract this to your modules folder like any other module. It does not need to go inside the fieldable_panels_panes/ folder but will work just as well under fieldable_panels_panes/modules/ (which is where the patch stores it).
Comment #5
magicmyth CreditAttribution: magicmyth commentedOh yeah forgot to mention. @merlinofchaos and co, I called the sub-module fpp_entity because fieldable_panels_panes_entity is a really long module name. But I think fppanes_entity would also be practical and maybe limit name-space collision a bit more?
Comment #6
DamienMcKennaIt shouldn't be a submodule, all you have to do is put the entity API hook into a .info.inc file and it'll work.
Lets refocus this issue on Token integration and move the Entity API work to #2237137: Add Entity API support.
Comment #7
magicmyth CreditAttribution: magicmyth commentedGood to see Entity API bits committed. Thanks DamienMcKenna.
Comment #8
kclarkson CreditAttribution: kclarkson commentedGlad I found this issue. Let me ask the following questions
1. If token support is added will I be able to use the "see available tokens" UI so that I can select the correct token?
2. Will I be able to incorporate tokens in any text field similar to Display Suites "code fields" where I could create something like:
a href="tags/[term-name]" class="icon-[term-name]" >[term-id] posted by [author]
Comment #9
kclarkson CreditAttribution: kclarkson commentedI applied the patch from #2237137: Add Entity API support and token's were not made available in the body.
If there are other patches that need to be applied to make token support available please let me know.
Comment #10
kclarkson CreditAttribution: kclarkson commentedComment #11
DamienMcKennaMoving this to 1.7.
Comment #12
DamienMcKennaComment #13
DamienMcKennaThis needs some tests.
Comment #14
rsbecker CreditAttribution: rsbecker commentedThe module version of this fix does not play nicely with other modules.
The patch version does not have these problems.
Comment #15
DamienMcKenna