• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • 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