• 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

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

No default title for images

derekmlr

Chevereto Member
Hey,

I'm assuming I change something in chevereto.js, but I'd like to stop it from giving uploaded images default titles (which happen to be the file name). Basically, either the user provides a title or there's no title. Works well with the theme I'm making and is similar to Imgur in that sense.

And yes, I do understand that this would make upgrades trickier.

Thanks!
 
app/lib/chevereto.js

Code:
                        if(typeof file.name !== typeof undefined) {
                            var basename = PF.fn.baseName(file.name);
                            title = $.trim(basename.substring(0, 100).capitalizeFirstLetter()/*.replace(/\.[^/.]+$/g, "").replace(/[\W_]+/g, " ")*/);
                        }

Just get rid of that.
 
app/lib/chevereto.js

Code:
                        if(typeof file.name !== typeof undefined) {
                            var basename = PF.fn.baseName(file.name);
                            title = $.trim(basename.substring(0, 100).capitalizeFirstLetter()/*.replace(/\.[^/.]+$/g, "").replace(/[\W_]+/g, " ")*/);
                        }

Just get rid of that.

So, it doesn't appear to show the file name in the title field when editing an image before uploading (which is good), but seems to still use it on image lists and on the image viewing page (/image/). Is that a template problem or?

I removed chevereto.min.js and refreshed cache (with console.log() etc to test if the JS was updated) and seemed to be.

Thanks!
 
I believe that in older versions I use !$var instead of array_key_exists() to tell if there is a title set for the image. When you use !$var the thing will show true even for those which are set but null. You should check class.image.php, uploadToWebsite function.

Note: in v3.6.8 I'm doing that using array_key_exists()
 
I believe that in older versions I use !$var instead of array_key_exists() to tell if there is a title set for the image. When you use !$var the thing will show true even for those which are set but null. You should check class.image.php, uploadToWebsite function.

Note: in v3.6.8 I'm doing that using array_key_exists()
Yeah, it was adding the file name as the title in that function it seems.

Thanks for the tip! Working perfectly now :)
 
Back
Top