Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bryjbrown/transclude_token
A Drupal module for transcluding external content
https://github.com/bryjbrown/transclude_token
drupal drupal7 transclusion
Last synced: about 1 month ago
JSON representation
A Drupal module for transcluding external content
- Host: GitHub
- URL: https://github.com/bryjbrown/transclude_token
- Owner: bryjbrown
- License: mit
- Created: 2017-01-31T14:29:36.000Z (about 8 years ago)
- Default Branch: 7.x-1.x
- Last Pushed: 2020-05-02T15:59:59.000Z (almost 5 years ago)
- Last Synced: 2024-11-08T00:06:23.008Z (3 months ago)
- Topics: drupal, drupal7, transclusion
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Transclude Token
Transclude Token is a Drupal module that defines a token that can be used to [transclude](https://en.wikipedia.org/wiki/Transclusion) external content into a node. This can be very handy for when you want to reuse language from an outside source (or even an internal one) without having to copy and paste, which can be a pain if the outside source changes. transclude allows you to reference an @id tag in an external web page and load it dynamically, so that when the outside source changes, the reference in your page changes too.## Usage
You can transclude content into a Drupal node by using the transclude token, `[transclude:'https://url.to/transclude#anchor']` (be sure to quote the URL). Drupal will recognize this token, load the specified page, extract the section with the specified anchor, and output it into the node wrapped in a `` tag.Please note that in order for tokens to be recognized and expanded within nodes, the token_filter module must be enabled along with token replacement in any text format that it may be used with. See [http://www.ryanwright.me/cookbook/drupal7/contrib-modules/token-filter](http://www.ryanwright.me/cookbook/drupal7/contrib-modules/token-filter) for more information on how to configure token replacement in nodes.
## Prepping external content for transclusion
If you are in control of the external content to be transcluded, the easiest way to make it transclusion-friendly is to wrap the content you want to transclude in a `` tag. The transclusion token will then grab all of the content inside that ``. Note that the transcluded content does not have to be inside any particular element, but `` and `` are the most semantically valid choices.