Software

Hop Inject

Current Version: 5.1.0
  • EE3
  • EE4
  • EE5
  • EE6
  • EE7
  • Installation

    1. Unzip the folder to a temporary location on your local hard drive.
    2. FTP the files from their local folders to the same locations in your EE install’s /system/user/addons/ folder on the server.
    3. Navigate to Add-ons in your EE control panel and install the add-on. That’s it!

  • Usage

    1. Wrap the content to be processed in the {exp:hop_inject} template tag.
      {exp:hop_inject where="<p>" always_inject="yes"}
           Content into which you want to inject other elements.
      {/exp:hop_inject}
      • The where parameter gets a string that determines where an injection might occur, as determined by use of the {exp:hop_inject:injection} tag (See step 2).
      • The always_inject parameter determines what happens to injections that are outside the bounds of the content. For example, if you specify an injection at the tenth paragraph tag, but there are only seven paragraphs, what should happen to that injection?

        If always_inject=”yes”, then the injection will simply appear after the entire block of content. If it’s no, the block will be ignored. yes is the default value.

        Bonus: A negative number like -1000 puts the injected text appear before the entire block of content.
    2. Wrap each element you want to inject with {exp:hop_inject:injection} tags.
      {exp:hop_inject:injection separator="1" position="before"}
           Element to inject.
      {/exp:hop_inject:injection}
      Use multiple {exp:hop_inject:injection} for each element to be injected.
      • The separator parameter is very flexible. It represents the count of the element that’ll get the injection.

        You can clone content this way, too, by injecting it multiple times: separator=”3|6|9”

        Using a negative number for the separator counts up from the bottom. For example, separator=”-4” injects the element at the fourth separator occurrence from the bottom.
      • The position parameter is either before or after. By default, the injection will be made before the separator.
  • Example

    {exp:hop_inject where="</p>" always_inject="yes"}
    
     {exp:hop_inject:injection separator="1" position="after"}
        <span>Put this text after the first paragraph closing tag.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="8" position="before"}
        <span>Put this text before the eighth paragraph closing tag (in the 8th paragraph).</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="2|3" position="after"}
        <span>Put this text after the second AND third paragraph closing tags.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="8"}
        <span>Put this text before the eighth paragraph closing tag, too.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="-4" position="after"}
        <span>Put this text after the 4th paragraph closing tag counting from the end.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="300"}
        <span>Because of the large number, this text will appear after the entire content block.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="33%" position="before"}
        <span>Put this text before the calculated location at 33% of the paragraph closing tags.</span>
     {/exp:hop_inject:injection}
    
     {exp:hop_inject:injection separator="> 4 : 10%" position="before"}
        <span>Put this text before the 4th paragraph or 10% of the paragraph closing tags, whichever is bigger.</span>
     {/exp:hop_inject:injection}
     
     {exp:hop_inject:injection separator="> 5 : 90%" position="before"}
        <span>Put this text before the 5th paragraph or 80% of the paragraph tags, which ever is bigger.</span>
     {/exp:hop_inject:injection}
    
    <p>1</p>
    <p>2</p>
    <p>3</p>
    <p>4</p>
    <p>5</p>
    <p>6</p>
    <p>7</p>
    <p>8</p>
    <p>9</p>
    <p>10</p>
    
    {/exp:hop_inject}
  • Updating

    Updating is easy:

    1. Download a new version from this website, and extract on your hard drive.
    2. Upload the new files to their appropriate locations.

  • Uninstalling

    1. Navigate to the Add-Ons > Modules tab in your EE control panel and uninstall the module.
    2. Remove the add-on directory from your EE system folder on the server.

  • Version History

    Last updated: about 5 months ago

    5.1.0 - 2023-11-20

    Updated

    • Hello EE7

    5.0.3 - 2021-06-10

    Updated

    • README and add-on description

    5.0.2 - 2021-04-29

    Fixed

    • Removing empty line break in the Jump Menu file

    5.0.1 - 2021-04-15

    Fixed

    • Wrong file path fixed

    Updated

    • Old license convert script

    5.0.0 - 2021-01-08

    Updated

    • Hello EE6!

    4.1.0 - 2020-12-01

    Updated

    • Updating session cache syntax

    Added

    • Adding pi file to prompt the exp_plugins table row creation

    4.0.1 - 2020-07-21

    Fixing regex to get the conditional injection

    4.0.0 - 2020-05-26

    • Percentage positioning
    • Conditional injection
    • Hop License

    3.1.0 - 2016-11-15

    • Updated for EE3 & EE4
    • Piped Where parameter

    3.0.0 - 2016-07-11

    Updated for EE 3

    2.1.0

    • Fixed a case where always_inject was set to ‘yes’ but there were no instances of the thing at all to find.
    • Other cleanup, too.

    2.0.3

    Ah edge cases. Fixed a case where the number of paragraphs was just one short, but always_inject was set to ‘n’

    2.0.2

    Fixed the ‘always_inject’ parameter and got rid of two PHP notices.

    2.0.1

    Bug fix release for compatibility with EE 2.1.3 (Thanks owed to Michelle of solmagnus.com)

    2.0.0

    Initial release for EE 2.x, Includes version 1.2.0 for EE 1.6.x

    1.2.0

    Added ability to count from bottom, not just from top, Improved documentation

    1.1.0

    Code Cleanup

    1.0.0 - 2014-06-26

    Initial Release

Have a Project for Us?

Request a Proposal