• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

How to add Schemeless Links has an option after upload

ashkir

👽 Chevereto Freak
Hey all! So every upgrade of Chevereto I update the embed file to make Direct Links the default link given to my users over the image view page. Recently with Chrome and Firefox planning on blocking all "non-secure" sites I've been preparing for SSL. I got my CDN up on it and the main site will be done likely tomorrow. So to further support this I want to add a schemeless link option. I forgot to suggest it before suggestions were closed, so I'm adding it myself. I'm posting it here to share with all of you, plus I can remember how I did it! :)

Step One: Go to /app/themes/Peafowl/snippets/

Step Two: Download or Edit: embed.php.

Step Three: at the top of the file starting on line 7 you will find options, the first option will be viewer-links followed by direct links much like below:
Code:
            'viewer-links' => [

                'label'        => _s('Viewer links'),

                'template'    => '%URL_VIEWER%',

                'size'        => 'viewer'

            ],
            'direct-links'    => [

                'label'        => _s('Direct links'),

                'template'    => '%URL%',

                'size'        => 'full'

            ]

You may notice the format is consistent and easy to read and edit! :)

After this section:
Code:
            'direct-links'    => [

                'label'        => _s('Direct links'),

                'template'    => '%URL%',

                'size'        => 'full'

            ]

add a comma to the end of the closing bracket ] so it becomes ],

Step Four: Now add this section after the closed out bracket and new comma:
Code:
            'schemeless-links'    => [

                'label'        => _s('Schemeless links'),

                'template'    => '//YOURHOSTURL/%FILENAME%',

                'size'        => 'full'

            ]

For example like mine is cdn.nickpic.host I'll use //cdn.nickpic.host/%FILENAME%

Extra/Bonus
I like to make Direct Links the first result, because honestly I don't want to view the image page I just want to link to the image straight away! So I rearranged my order:
Code:
            'direct-links'    => [

                'label'        => _s('Direct links'),

                'template'    => '%URL%',

                'size'        => 'full'

            ],
          
            'viewer-links' => [

                'label'        => _s('Viewer links'),

                'template'    => '%URL_VIEWER%',

                'size'        => 'viewer'

            ],


            'schemeless-links'    => [

                'label'        => _s('Schemeless Links'),

                'template'    => '//cdn.nickpic.host/%FILENAME%',

                'size'        => 'full'

            ]

        ]

    ],

So %url% will give me the full CDN url I'm using right now. I'm using %filename% to cheat/reconstruct that :)
 
Back
Top