Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Islandora tokens? #1171

Closed
kayakr opened this issue Jun 19, 2019 · 7 comments
Closed

Islandora tokens? #1171

kayakr opened this issue Jun 19, 2019 · 7 comments

Comments

@kayakr
Copy link
Contributor

kayakr commented Jun 19, 2019

These are useful in pathauto paths, for default values in embedded entities, in metatag fields, etc.
I've suggested a linked-agent token e.g. [node:linked-agent:cre] at Islandora/controlled_access_terms#30 but perhaps there needs to be some wider discussion about where such tokens should live; in their own islandora_tokens module, or in some specific modules such as controlled_access_terms or even a linked_agent module?

@seth-shaw-unlv
Copy link
Contributor

With the caveat that I haven't done much of anything with tokens:

It seems logical to me to have token support added to controlled access terms since we define the LinkedAgent field here. However, the PR as it stands has some hard-coded expectations such as the field's machine name (field_linked_agent, defined in islandora_defaults) using the MARC relators ontology (used in controlled_access_terms_defaults, but others may use schema.org relationships instead).

I would suggest either 1) moving the code to islandora_defaults, since it does rely on a field from there, OR 2) a refactored PR to make it more generalized (perhaps using field types instead of a field's machine name?).

@dannylamb
Copy link
Contributor

Adding tokens for the results of our various EVAs would be super useful. For example, if we want to do schema.org metatags, then we need to be able to get at the thumbnail using a token for the node. Something like [node:media_thumbnail:url] to get the thumbnail url is how we could easily do that.

@kayakr
Copy link
Contributor Author

kayakr commented Jul 8, 2019

@dannylamb We're using something like this for dcterms & og & twitter metatags.

$info['tokens']['node']['service-file:url'] = array(
    'name' => t('Service file url'),
    'description' => t('Service file url.'),
  );
  $info['tokens']['node']['service-file:alt'] = array(
    'name' => t('Service file image alt'),
    'description' => t('Service file image alt.'),
  );

I can share more code in a week.

@kayakr
Copy link
Contributor Author

kayakr commented Sep 1, 2019

@dannylamb I've made a start at https://github.com/kayakr/islandora_tokens

@dannylamb
Copy link
Contributor

@kayakr Can haz PR? That looks like a great start. I'd go ahead and stick it straight into islandora.module.

@wgilling
Copy link
Contributor

wgilling commented May 3, 2021

Ok - now there are two separate pull requests that should put all of the tokens under either controlled_access_terms or islandora depending on the token's dependencies. These are: Islandora/controlled_access_terms#66 and Islandora/islandora#836

@wgilling
Copy link
Contributor

@dannylamb Since Islandora/islandora#836 has already been merged and closed, a new PR has been made for the islandora project for the commits that put the pdf_url token functionality there. Please see Islandora/islandora#844 for that new PR. Please let me know if there any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants