Feature Request: Smart-Link

Permalink Browser Info Environment
Dear Ramon
We came over an issue with linking. We did some teaser-blocks with images and text. And the customer likes to set the link always different:
- internal by picking a site
- external by entering an url
- linking a file form file-manager

We now create different blocks. Our request is: smart-link

In our idea if we insert a smart-link the user who fills out the form can choose which kind of link he will use.

What do you think about that? Is something similar already possible but we don't see how?

best regrads, Roland

Type: Discussion
Status: Resolved
webpresso
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Roland,

Currently, this is not possible. I know what you want to achieve, but it's not available in Block Designer. Not sure if there will be a good solution for this, because I can image some may only want internal/external, some may want all 3. Some may even want different classes for all 3 options and whatnot. I will put a note on my todo-list, but I can not promise you anything. As I'm currently swimming in work, I can say for sure that this is not going to be possible within the next 4 weeks. So if you're looking for a short-term solution, keep making different blocks, or 1 block with the different field types, and do some scripting/edits yourself to the block.

Block Designer was intended to create the bare bones of blocks, not have complicated sophisticated things like these. That's why it has all the "normal" fields, which you can combine. If you have the knowledge, perhaps you can rewrite some to the block you're generating?

Kind regards,

Ramon
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Roland,

I've been working on the "Smart Link" field type. Took me a bit longer, but busy times (business wise and personal wise)...

What I've got now is a Smart Link field type with 4 options for links:

- Page (using the page selector)
- URL (external or whatever, as long as it's a valid URL)
- File (using the file selector)
- Image (using the file selector, but only with images, no other files)

Next to this, you can set up within Block Designer whether to exclude options from the above list. So you can chose to have "Page" and "URL" only (if you don't need the file/image choices). As long as you leave 2 there (otherwise you don't need smart link, as it's only 1 field type).

Next to that, there is a possibility to add a class to the link and when chosen for "URL" it will open in a new window.

Also, the user can enter a "Title" field, which will overrule either:

- The page name - page
- The URL - URL
- The file name - file
- The file/image name - image

Each link will output <a href="the-url-here" class="maybe-a-class">The title here</a>, so also for files. Does that make sense? This because I can imagine some would want to output the image, but then you need max width/height too maybe and such things. Just figuring out what you were going to use it for. I think the current setup is already quite OK with a lot of use-cases (also since I pass along the file object, so you can always edit the view.php file yourself).

Let me know what you think. I will be updating bits and pieces in the meanwhile.

Kind regards,

Ramon
ramonleenders replied on at Permalink Reply
ramonleenders
Added it in version 2.5.1 (Pro), you will need to update Block Designer too (or else it won't show).

I'll also email, just in case you are not getting notified here.

Kind regards,

Ramon

concrete5 Environment Information

5.7.5.6

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.