ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Link only when inserting image

August 09, 2012 6:05pm

Subscribe [2]
  • #1 / Aug 09, 2012 6:05pm

    ronanmcmahon

    13 posts

    This question may be related to a resolved thread.

    Hello, I would like to be able to insert link only, what would the syntax for this be?

    I’ve tried a few combinations but I can’t seem to get it to work.

    So for example when inserting an image, I would like it to insert the link only, like this:

    https://ellislab.com/asset/images/ent-partner-logo/imagename.jpg

    Is this possible?

     

  • #2 / Aug 10, 2012 1:22pm

    Shane Eckert

    7174 posts

    Hey ronanmcmahon,

    Thank you for posting your question here on the ExpressionEngine forums.

    I think what you want to do is call the channel field for the file upload destination that you have uploaded the image to.

    Then call it like so.

    {exp:channel:entries channel="blog"}
    {channel_field_for_image}
    {/exp:channel:entries}

    That should give you something similar to http://www.example.com/assets/images/image1.png

    Does that make sense?

    Cheers,

  • #3 / Aug 10, 2012 1:50pm

    ronanmcmahon

    13 posts

    Yes I already have that in my template.

    I’m talking about when inserting the image on the entry, it inserts it like this:

    https://ellislab.com/asset/images/ent-partner-logo/imagename.jpg

    I would like it to insert the filename link only, like in EE1.x

  • #4 / Aug 10, 2012 5:50pm

    Shane Eckert

    7174 posts

    Hi ronanmcmahon,

    What do you get if you just use

    https://ellislab.com/asset/images/ent-partner-logo/

    - does that output the link?

    Thank you,

  • #5 / Aug 13, 2012 1:01pm

    ronanmcmahon

    13 posts

    Hello,

    That doesn’t seem to work either.

    I’ve also followed the instructions here: http://ellislab.com/forums/viewthread/164998/ and it doesn’t work either.

    I’ve tried using the the channel field only({photo}), {photo wrap="image"} and none seem to display anything, nothing shows up on the actual site. This based on http://ellislab.com/expressionengine/user-guide/modules/channel/custom_fields.html

  • #6 / Aug 14, 2012 4:01pm

    Kevin Smith

    4784 posts

    Just to back up and take a fresh look at this, were you intending to have

    https://ellislab.com/asset/images/ent-partner-logo/imagename.jpg

    show up within a text field in your CP, or did you just want to select that image in the CP and then output the proper URL on the front-end?

    What’s the ultimate goal here?

  • #7 / Aug 15, 2012 8:18am

    ronanmcmahon

    13 posts

    Just to back up and take a fresh look at this, were you intending to have

    https://ellislab.com/asset/images/ent-partner-logo/imagename.jpg
    show up within a text field in your CP, [...]

    Yep, that’s exactly what I’m trying to do. Just like EE1.x and the URL only option when uploading/inserting an image

  • #8 / Aug 16, 2012 12:37pm

    Kevin Smith

    4784 posts

    Ok, using a text field with the file chooser is always going to fill the text field with an IMG tag, not just the URL to the image. And that, of course, is what will be output to the front-end when you use the Channel Entries tag in your templates.

    If you’d like the Channel Entries tag to just output

    https://ellislab.com/asset/images/ent-partner-logo/imagename.jpg

    (where the filedir_2 variable is actually parsed), then I’d recommend using the SafeCracker File fieldtype instead. It’s actually more user friendly, too, since the end-user editing content will see a thumbnail preview of the image they selected instead of a field with an EE variable and an image filename.

    Will that work for you?

  • #9 / Aug 17, 2012 10:25am

    ronanmcmahon

    13 posts

    Hello,

    Yes I’ve already tried using File as fieldtype, but it didn’t work either. There was no url outputted, so on the front-end(the actual site) the code looked like this

     
  • #10 / Aug 17, 2012 4:36pm

    Kevin Smith

    4784 posts

    Were you using the File fieldtype or SafeCracker File? They’re two different things. Try giving the second one a try. If it doesn’t output a URL, we’ll dig into that with you.

  • #11 / Aug 20, 2012 11:10am

    ronanmcmahon

    13 posts

    Hello,

    I tried with SafeCracker File, and unfortunately it doesn’t output a url.

  • #12 / Aug 21, 2012 11:36am

    Shane Eckert

    7174 posts

    Hey ronanmcmahon,

    I think it’s time to take a look.

    Please be on the look out for an email from EllisLab.

    Cheers,

  • #13 / Aug 29, 2012 11:30am

    Dan Decker

    7338 posts

    I checked with Robin on this and in ExpressionEngine 2.x, there is no way to get the File Manager to work like you are asking with text fields.

    You can get the same effect if you use a File FIeld type:
    http://ellislab.com/expressionengine/user-guide/modules/channel/custom_fields.html#file-field

    Changing that may have an impact on existing entries though.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases