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.
Currently, views implements its own token replacement. This is used in areas, titles, among others. We should explore adding support for core tokens. We could then have, for example, the site name token available for area text, which we don't have now.
I would also hope that maybe this will make the Result area handler obsolete, as we would in theory have global view tokens for things like result count and items per page.
This issue is not for the actual tokens provided. See related issues below.
Related:
Comment | File | Size | Author |
---|---|---|---|
#16 | 1818450-16.patch | 8.98 KB | damiankloip |
#15 | 1818450-15-tests.patch | 2.89 KB | damiankloip |
#15 | 1818450-15.patch | 8.97 KB | damiankloip |
#13 | diff.png | 62.33 KB | dawehner |
#11 | 1818450-11.patch | 6 KB | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedHere is an initial patch. I haven't spent much time on this yet, just adding what I have for now. It's always good to get feedback, regardless of the state.
This implements 3 new methods on PluginBase to do token replacement, get available tokens, and provide a form helper method to add available tokens for forms.
Comment #2
aspilicious CreditAttribution: aspilicious commentedAdd a newline
In an oop world helper methods are private. If they must be public they are not "helper functions". And than we shouldn't start this sentence with "Helper function" but with a 3th person verb just like we do in other places :)
Comment #3
dawehnerJust adding a tag.
Comment #4
damiankloip CreditAttribution: damiankloip commentedHere is a new patch, just including aspilicious' comments.
Comment #5
xjmComment #6
fastangel CreditAttribution: fastangel commentedI attached new patch with reroll.
Comment #7
damiankloip CreditAttribution: damiankloip commentedHere is a patch including some basic integration with core tokens for Text and TextCustom handlers.
Comment #9
damiankloip CreditAttribution: damiankloip commentedok, I think this actually seems to be an issue with theme_item_list in D8.
Comment #10
damiankloip CreditAttribution: damiankloip commentedScrap that, you need to use '#markup' and not 'data'!
Comment #11
damiankloip CreditAttribution: damiankloip commentedAdded support for the title override area handler too.
Comment #12
xjmComment #13
dawehnerBefore and after is pretty much the same, as expected.
Comment #14
damiankloip CreditAttribution: damiankloip commentedNice, thanks for the confirmation dawehner. I will write some tests.
Comment #15
damiankloip CreditAttribution: damiankloip commentedA few tests.
Comment #16
damiankloip CreditAttribution: damiankloip commentedHow about we just merge these tests in with the existing handler output and UI tests?
Comment #17
dawehnerCouldn't we split this up in an extra method (testRenderArea maybe?) and move the UI tests into an extra file, but this is a followup.
Comment #19
damiankloip CreditAttribution: damiankloip commented#16: 1818450-16.patch queued for re-testing.
Comment #20
damiankloip CreditAttribution: damiankloip commentedok, the patch in #16 is actually fine and green. http://qa.drupal.org/pifr/test/390373
Comment #21
dawehnerI agree that my comment in #17 is more a topic for a follow up.
Comment #22
xjmCan we file the followup now? :)
Comment #23
dawehner#1851166: Split Views Area functionality and UI tests
Comment #24
webchickSeems like a nice little improvement.
Committed and pushed to 8.x. Thanks!
Comment #25.0
(not verified) CreditAttribution: commentedUpdated issue summary.