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?

#4 fpp_entity.zip8.14 KBmagicmyth
#3 1798482-fppanes-entity-api-integration-3.patch2.71 KBmagicmyth
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View


heylookalive’s picture

If you require tokens for FPP you can just enable the entity_tokens module that comes with entity api.

BarisW’s picture

I'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?

magicmyth’s picture

Title:Would it be helpful for FPP to have token support?» Token support - Entity API integration
Issue summary:View changes
Status:Active» Needs review
new2.71 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View

As 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! ;)

magicmyth’s picture

Related issues:+#2018329: Allow context keyword substitutions in FPP
new8.14 KB

As 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).

magicmyth’s picture

Oh 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?

DamienMcKenna’s picture

Title:Token support - Entity API integration» Improved(?) Token support
Status:Needs review» Needs work

It 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.

magicmyth’s picture

Good to see Entity API bits committed. Thanks DamienMcKenna.

kclarkson’s picture

Glad 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]

kclarkson’s picture

I 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.

kclarkson’s picture

DamienMcKenna’s picture

DamienMcKenna’s picture