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.

Photo Gallery - Listing img src code

July 29, 2007 1:46am

Subscribe [2]
  • #1 / Jul 29, 2007 1:46am

    Arun Shanbhag

    15 posts

    In the Photo Gallery, I wanted to have the
    img src code for each image listed (along with the complete url).

    The hope is that I can then copy the code and drop it in the middle of an entry.
    (similar to what a file upload would do, but having the advantages of batch upload and the potential to setup a Gallery).

    In the template when I added the following code where the caption would be, of course, it faithfully shows the image again.

    {image_url}

    and does not give me the code for each image.

    Obviously, there is a simple way to show only the code itself, no?  (similar to what Photobucket does for each image).

    And if I wanted to have this img src code show up in the “View Entries” list in the Gallery, in which template and where do I manipulate.  I don’t find a template for the “View Entries” listing.

    Sorry, if these are very basic queries.
    Arun

  • #2 / Jul 29, 2007 10:21am

    Robin Sowell

    13255 posts

    EE tags aren’t parsed if they are inside the entry fields themselves- that’s true of both the gallery and the weblog.  Thus you’ll see the unparsed code.  There is a plugin that allows you to work around this- Allow EE Code- though be sure to read the warnings.  The concern is, you give your authors a lot of power if they can put tags inside of their entries, so use it wisely.  (I’ve never tried it inside the gallery, but it’s the first thing I’d suggest.)

    As to the ‘View Entries’ listing- you’re talking the backend, correct?  The backend isn’t templated, so you’d need to know php in order to make edits there.  In this case, you’d need to edit system/modules/gallery/mcp.gallery.php.  In truth, I wouldn’t suggest it, as it would be a hack, which I try to avoid.  They make upgrades unpleasant.  You might be able to use an extension hook to do it, but I can’t think of one for that particular modification.  (Also possible I’m not quite understanding what you want to tweak- but I think I do.)

    Make sense?

  • #3 / Jul 30, 2007 11:23am

    Arun Shanbhag

    15 posts

    Thank you Robin, for the cautionary note.
    Now that I think about it more carefully, you are absolutely right!  Not a good idea.
    and yes, I don’t have the skills to work with the back-end stuff.  Will just find another way to work around my needs.
    Thanks
    Arun

  • #4 / Jul 30, 2007 11:30am

    Robin Sowell

    13255 posts

    Hm- you might could do a string replace?  Put in a placeholder where you want the link to go- something like [link]- there is a Find and Replace plugin that MIGHT work.  You also might run into parse order issues with it, so might take a little tweaking.  But you could replace [link] with with the rendered {image_url} bit.  Think it would be doable.  Worth playing with a bit.

  • #5 / Jul 31, 2007 4:22pm

    Arun Shanbhag

    15 posts

    A simple change was required.  I inserted this line in the image_full template, just below the comment.
    Instead of open triangles, I used the ASCII character codes.  I am not a techie, but it seems that EE just converted the ASCII character codes to open and close triangles and parsed the EE tags - giving me the img src tags that I was looking for.  (and did not actually run the now complete code).

    & lt;img src="{image_url}" width="420" alt="{title}" title="{title}"& gt;

    (remove extra space above in ascii code)

    I even placed this in the main index template, just below the title. Ofcourse, its a long tag and looks ugly.

    And after reading Robin’s cautionary note, i was not sure i wanted everyone to know the exact url of all the images.  So I have commented it out!  When I have a few minutes, I will likely wrap this line in a Member conditional, so only I can see the img src code.

    Thank you for your help and suggestions.
    Arun

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

ExpressionEngine News!

#eecms, #events, #releases