• 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

Adding Links in Image Descriptions..... How?

Phil Boyd

Chevereto Member
I searched around the forum and saw this question was asked sometime ago.
The answer was that the feature had been disabled but could be enabled by "copying the code that you will find in user.php".

Could someone give a little more specific answer?
 
Descriptions can contain URLs but the system won't link these URLs.
 
Ok, that brings me back to my original question..................
How do I go about enabling it by "copying the code that you will find in user.php"?
 
Ok, please forgive my ignorance - I'm not a coder.
But I assume what you are saying is I have to edit the user.php file to include the linkify function?
 
No, image.php

Linkify (turn URLs into links) using that function. The argument should be the description.
 
I never noticed how hard this could be for someone who doesn't code. Yep, I saw this: https://www.sitepoint.com/community/t/i-want-to-linkify-something/280826

Let me explain in detail how simple this is, but please read. Don't skip one single word. Don't worry, is not that complicated.

1. You need to know exactly what you want to modify. There is a complete guide on how to find something, here.

If you inspect using your browser, you will get something like this:

upload_2017-11-12_23-43-16.png
As is explained in the guide.

You need to find this: description-text margin-bottom-5

2. As I told you earlier, the code is on app/themes/Peafowl/views/image.php

From there, you only need to pass the description to the linkify function. Indeed this is simple as changing this:

PHP:
<?php echo nl2br(get_image_safe_html()['description']); ?>

To this:

PHP:
<?php echo nl2br(G\linkify(get_image_safe_html()['description'])); ?>

If you want to avoid passing juice (SEO) replace G\linkify with CHV\linkify_redirector in the code above.

Easy isn't?

By the way, G\ is the namespace. The function declaration is made inside the namespace, so the function declaration is written without the namespace.
 
I have searched through the code, both the user.php and image.php. I saw NOTHING....

@Oakley rolls eyes....

Why are you looking for "G\linkify($var)", thats not what Rodolfo said above?

He said you should using that to create the links by adding it and amending the existing code.

You are looking for "description-text margin-bottom-5" in image.php

Note that image.php exists in several places but the one you want is here:

app/themes/Peafowl/views/image.php

And the piece of code you are looking for is on line 141:

description-text margin-bottom-5

Then edit that line as instructed above.

Make sure you keep a copy of existing files in case you mess em up.
 
@Oakley rolls eyes....

Why are you looking for "G\linkify($var)", thats not what Rodolfo said above?

Gee, I don't know. Maybe it's because in one of his previous answers he said

You can use the function at views/user.php to display links. Which function? G\linkify($var)

That was the only thing that had anything at all to do with linkify code so I figured i searching there.

@Rodolfo
, thank you for breaking it down and simplifying it for me. I do appreciate it. Your answers make a little more sense.

I'll just be honest. I find many of your answers hard to wrap my head around, and not just the ones to me. To me they are rather short and abrupt. Now if I was more experienced I'm sure I'd understand them better. That's why I posted at Sitepoint. I was hoping someone there could help me a little with what you were saying.
There's alot I'd like to do with Chevereto and alot I'd like to learn but I get the impression your very busy and don't have much time for "tutoring". I get that, I do. I was really hoping someone who has done a little with Cheverto could have answered me.

But thank you for the links to those guides. I'll look those over first chance I get.

Have a good one.

 
Back
Top