2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

image

axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  • Tuesday, February 6, 2018
  • by axllent
  • Repository
  • 1 Watchers
  • 0 Stars
  • 498 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 3 % Grown

The README.md

Automatically set target="_blank" for outgoing & file links in Silverstripe

This module enhances your HTML output by automatically adding target="_blank" to all outgoing links and internal "download links" (e.g., PDF, ZIP, TAR, DOC, PPT, and Excel files)., (*1)

Earlier versions of this module used JavaScript for similar functionality, but that approach caused compatibility issues with tools like the Wayback Machine., (*2)

Features

  • Automatically adds target="_blank" to outgoing and internal file links.
  • Includes rel="noopener" to outgoing links to prevent cross-site exploits.
  • Optionally adds rel="nofollow" and rel="noreferrer" to outgoing links.
  • Allows adding custom CSS classes to file and external links for styling.
  • Supports adding additional file extensions for custom file types.

Requirements

  • Silverstripe ^4 || ^5 || ^6

Installation

composer require axllent/silverstripe-links-to-blank

After installation ensure you have done a ?flush. No further configuration is required., (*3)

Usage

To customise the module, you can define your own configuration:, (*4)

Axllent\LinksToBlank\Middleware:
    ## Specify additional external hosts to exclude from processing.
    ## The current host is automatically excluded.
    ignore_hosts:
        - "www.example.com"

    ## Exclude links with this CSS class from being parsed (default: none).
    ignore_css_class: "ignore-link"

    ## Add a CSS class to all external links (default: none).
    add_css_external: "external-link"

    ## Add a CSS class to all file links (default: none).
    add_css_files: "download-link"

    ## Define custom file types to be treated as file links.
    ## Each file type should include the leading dot.
    add_file_extensions:
        - ".ext"

    ## Add rel="nofollow" to all external links (default: false).
    nofollow: true

    ## Add rel="noreferrer" to all external links (default: false).
    noreferrer: true

The Versions

06/02 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

javascript silverstripe links

06/02 2018

dev-silverstripe3

dev-silverstripe3 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

javascript silverstripe links

17/10 2017

2.0.3

2.0.3.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

09/06 2017

1.2.3

1.2.3.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

09/06 2017

2.0.2

2.0.2.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

24/03 2017

2.0.1

2.0.1.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

29/01 2017

1.2.1

1.2.1.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

29/01 2017

1.2.2

1.2.2.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

29/01 2017

2.0.0

2.0.0.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

27/11 2016

1.2.0

1.2.0.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

10/06 2016

1.1.0

1.1.0.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links

21/12 2015

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-links-to-blank

Extension to add JavaScript to all pages to add target="_blank" to all outgoing links & downloads

  Sources   Download

The MIT License (MIT)

The Requires

 

javascript silverstripe links