Closed (fixed)
Project:
Country Pages
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Jan 2015 at 09:18 UTC
Updated:
24 Apr 2015 at 08:34 UTC
Jump to comment: Most recent, Most recent file
As countries can be pages, an option to have a country field displayed as a link to the page of that country would be a welcomed feature.
Comments
Comment #1
clemens.tolboomAttached patch adds a display format.
Comment #2
clemens.tolboomFixed:
Whitespace error
Comment #3
alan d. commentedWe should use country_property($country, 'name') or entity_label() for i18n.
We also loss a lot of the options that are provided by the base module.
If Field formatter settings API module is added as a dependency, you could actually just modify the existing widgets to link to the countries page... "Link to content".
i.e. Example usage (on any field) is Field formatter class module
Another option is to provide token based link paths back in the countries module itself, which has probably a lot more use cases:
Integration with this module:
country/[country:iso2]
A possible real example for one of our sites, Integrating with views (using contextual filters) + og
groups/[country:iso2]
Thoughts?
Comment #4
clemens.tolboom@Alan D. thanks for the feedback. Will follow your leads.
Comment #5
clemens.tolboomI fixed for #3
in feature branch [edit] http://cgit.drupalcode.org/sandbox-aland-2362909/log/?h=feature/display-... [/edit].
Following https://www.drupal.org/project/field_formatter_settings next to https://www.drupal.org/project/field_formatter_class I ran into #1616426: Compatibility with Display Suite which seems to be a DS Bug still open #1875750: Allow DS core fields to have alterable settings, include them in field_info_instance_settings()
I'm testing this option still.
I like the token based path as that frees the hard coded path. Will dive into this too.
Comment #6
clemens.tolboomI followed the token route. Please review.
Comment #7
clemens.tolboomI forgot token helper for widget. And changes some descriptions.
Better wording.
Better wording.
For changes done see feature branch http://cgit.drupalcode.org/sandbox-aland-2362909/log/?h=feature/display-...
Comment #8
hanno commentedThe link results in
<a href="/name">Denmark</a>. The value in the config iscountry/[country:iso2], so I would expect<a href="/country/dk">Denmark</a>Comment #9
clemens.tolboomWhile developing I did a lot
which helped to see my code changes. Maybe that helps.
Comment #10
hanno commentedLooks to me a typo in line 137:
should be something like
Comment #11
clemens.tolboom@Hanno thanks for testing. Committed on feature branch.
Are you OK with the widget labels/descriptions?
Comment #12
alan d. commentedIt would be better to use the popup imho.
Comment #13
clemens.tolboom@Alan D. indeed way better.
Are we now RTBC ?
Comment #14
clemens.tolboomChecking against the token docs https://www.drupal.org/documentation/modules/token it seems better to use
Comment #15
alan d. commentedNo worth re-rolling, but a couple things
"l($title,$path));" space after the comma
We are deep in site admin config here, but without Token and if they change the values, they could find things hard to repair.
Maybe
"Use tokens for context. i.e. country/[country:iso2]"
"Use tokens for context. i.e. [country:name]"
Happy either or
Manual code review rtbc from me :)
Comment #16
alan d. commentedi.e. one t() string 'Use tokens for context. i.e. %example' in case that wasn't obvious.
Comment #18
clemens.tolboom