• 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.
  • Chevereto Support CLST

    Support response

    Support checklist

Custom embed codes

j2k

Chevereto Member
How do I create my custom embed codes in addition to (or replace) the default ones in the "Actions > Get embed codes" section?

I would prefer not to drastically modify the core code to interfere with the future update.
 
I think, and I could be wrong on this... The image.php file in the theme should have the embed codes. You may have to follow it backwards to figure out where they're actually from.
 
That one is generated with php and js, is not that easy to inject.
 
I'm making a copy of the /app/routes/route.image.php to /app/routes/overrides/route.image.php

I only did some minor edit to test in the HTML iamge section, eg. changing border="0" to border="5"

But nothing happens when I view the embed codes in the Dashboard.

When getting embed codes in album view, border="0"

When getting embed codes in individual image view, border="1"

Do I need to register my overrides to activate it? Or delete the original one route.image.php?


It's working for displaying embed codes when viewing individual image.

However, when getting embed codes in album view for all the images, it's still showing the default border="0"

Is there addition files I need to do overrides with in order to modify the album view embed codes?

I also notice there's a file /app/themes/Peafowl/snippets/embed_tpl.php

Do I need to do anything with it?

I also need to do some custom modification with the image url via Regex, where should I get started?

I don't mind hacking the js / php a bit further.

This is the last step and critical to the integration for my management workflow.

Please advise.

Thanks.
 
Last edited:
when getting embed codes in album view for all the images, it's still showing the default border="0"

You need to edit app/routes/route.album.php, each route has his own parameters. It could need some theme editing.

I also notice there's a file /app/themes/Peafowl/snippets/embed_tpl.php
That one is used to generate on the fly codes, like the ones from the uploader and when you select some images and then select "Get embed codes".

I also need to do some custom modification with the image url via Regex, where should I get started?
What exactly do you need to do?
 
I'm curious to how much you've edited Chev...
Currently I haven't touched anything on the core yet.

I've created some custom routes to achieve other task automation via cron job.

I tried to avoid touching the core so there will be no conflict for future upgrade.
 
You need to edit app/routes/route.album.php, each route has his own parameters. It could need some theme editing.
I'm looking at app/routes/route.album.php and couldn't find anything with reference to the keyword "border" or "embed".

Is the generation of embed codes being called from elsewhere other than route.album.php?

The only other reference I can find with border="0" is in the /app/themes/Peafowl/snippets/embed_tpl.php

Can I do overrides on a snippet?

That one is used to generate on the fly codes, like the ones from the uploader and when you select some images and then select "Get embed codes".
And yes, what I need is to modify the part of "Get embed codes" after selecting all the images in a single album.

What exactly do you need to do?
hat I'm trying to achieve is to alter the default "Embed codes" > "HTML Codes" > "HTML image" section, for all the images in an album from:

<img src="http://domain.com/images/2016/03/30/filename.jpg" alt="filename.jpg" border="0">

to

<img src="http://another-domain.com/newpath/2016-03-29/filename.jpg">

I could have manually done it in Sublime Text within 10 seconds, but if I can customize the embed codes, it would be less prone to human error.

In this case, which files should I be working on the modification?

Thanks.
 
Back
Top