Closed (fixed)
Project:
Panels
Version:
8.x-4.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2016 at 10:49 UTC
Updated:
7 May 2019 at 18:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sylus commentedSeems to work for me:
[node:title]
[site:name]
Comment #3
benjy commentedThis really needs a token browser like #2561947: Use token browser for "Page title" field
Comment #4
damienmckennaComment #5
damienmckennaComment #6
damienmckennaComment #7
Sinan Erdem commentedFor starters, even changing the description under the field would help. Instead of this:
This:
Comment #8
millionleaves commentedI have a variant for a node type. That node type has a field called field_title (not to be confused with node:title). I enter the following into the title field in my variant:
[node:field_title] [node:title]
This should render to something like:
Dr Bob Smith
but instead renders to
[node:field_title] Bob Smith
I have checked that this is the correct token for my field.
Am I doing something wrong, or are node tokens other than [node:title] not supported in the title field?
Comment #9
manuel.adanTokens for taxonomy terms have "term" as the token type ID. So the right token for that is [term:name], see #737726: Unify token types with entity type names (taxonomy_term vs term) that hopefully will be solved by #2163027: Type token returns in a typed data recognizable format.
@millionleaves, probably there were two (or more) contexts with the "node" type. Tokens work only for the last one. Please, @see #2851663: Multiple contexts of same type - all but one ignored for page title tokens.
Patch from #2561947-12: Use token browser for "Page title" field could be ported here.
Comment #10
lamp5Hi, I prepared port of patch from #2561947-12.
Please review.
Comment #11
joelpittetThis needs some coding standards cleanup but does seem to work. Thanks for the patch @lamp5. Would you mind indenting 2 spaces? And add that same comment:
Comment #12
lamp5Thanks, @joelpittet for your review.
Comment #13
lamp5Comment #14
joelpittet@lamp5 much better via the coding standards!
There is a new problem that I ran into recently with menu_block. Core can change the __constructor as it's @internal implicitly and if we extend from things we break them.
There is a couple ways to fix them, still a bit torn on which way is best:
I've done both ways in patches on this issue for reference: #2968049: Dependency Injection issue
Curious to know your thoughts?
Comment #15
lamp5@joelpittet I do not especially know what is the reason in this case that we should use decorator or extra method to inject this service. PanelsContentForm has already constructor to create SharedTempStoreFactory so if in the future FormBase constructor will change, this object constructor will also have to be changed.
Comment #16
lamp5Reroll to the latest dev.
Comment #17
joelpittet@lamp5, I agree. Committed and pushed to the dev release.
I guess if anybody extends this class with their own dependencies they may need to tweak things in the constructor.