S-Tag to check if an image file exists.

Options
Wanting to build out a conditional using S-Tags that will render content if an image file by a specific name exists in the LO image library.


Tried using he S151 tag but either it doens't work with Image Files or I don't have the right parameter path to get it to render TRUE.


Anyone have any additonal ideas?


Cheers,
Tagged:

Comments

  • JP Provencal:

    Wanting to build out a conditional using S-Tags that will render content if an image file by a specific name exists in the LO image library.


    Tried using he S151 tag but either it doens't work with Image Files or I don't have the right parameter path to get it to render TRUE.


    Anyone have any additonal ideas?


    Cheers,

    I'm not aware of an S-Tag for this, but you can check if a file at a given url exists with JQuery. 

     

    <span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">$</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">ajax</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">({</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> url</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39);">'http://www.example.com/somefile.ext'</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">,</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> type</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39);">'HEAD'</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">,</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> error</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148);">function</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">(){</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147);">//do something depressing</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">},</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> success</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148);">function</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">(){</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147);">//do something cheerful :)</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">}</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);"><br/></span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54);">});</span>
    http://stackoverflow.com/questions/3381663/how-to-check-if-image-exists-with-given-url

  • Colleen Gutierrez
    Colleen Gutierrez Blackbaud Employee
    Ancient Membership 10 Comments 25 Likes Photogenic
    Looks like S46 was missing from the docs! I've added it: https://www.blackbaud.com/files/support/helpfiles/luminate-online/help/luminateonline.html#../Subsystems/S-Tags/Content/S-Tags/S46_Check_File_Exists.html


    Please let me know if I can improve it in any way!


    Thanks,

    Colleen
  • I don't want to hijack this post, but could there be other S-Tags that could be missing from the docs?


    How often is this doc(s) reviewed?


    One reason I ask is that on this page:

    https://www.blackbaud.com/files/support/helpfiles/luminate-online/help/luminateonline.html#../Subsystems/S-Tags/Content/S-Tags/Platform.html


    You will see S202 Add a GIGYA login component. GIGYA is long gone now.


    This should be one of the Spring into Action challenges. #documentationspringcleaning


    Thanks,


    Phil
  • Colleen Gutierrez
    Colleen Gutierrez Blackbaud Employee
    Ancient Membership 10 Comments 25 Likes Photogenic

    Philip Nawrocki:

    I don't want to hijack this post, but could there be other S-Tags that could be missing from the docs?


    How often is this doc(s) reviewed?


    One reason I ask is that on this page:

    https://www.blackbaud.com/files/support/helpfiles/luminate-online/help/luminateonline.html#../Subsystems/S-Tags/Content/S-Tags/Platform.html


    You will see S202 Add a GIGYA login component. GIGYA is long gone now.


    This should be one of the Spring into Action challenges. #documentationspringcleaning


    Thanks,


    Phil


    Aah, good catch, Philip!  S202 is still used for adding a social media log in component. I missed updating the word "Gigya" on that Platform S-Tags topic. I've made the update.


    The LO docs are updated as we learn of needed updates. If you have any feedback, just let me know, and we'll work toward improvements. At this time, I don't know of any other missing S-Tags. 


    Thanks, 

    -Colleen
  • The LO docs are updated as we learn of needed updates. If you have any feedback, just let me know, and we'll work toward improvements. At this time, I don't know of any other missing S-Tags.
    That pretty much leaves it up to us to stumble on a new tag out of Noah.


    If you look back at through the history of this community this exact scenario has played out repeatedly. We all pound our heads on some problem, and Noah mentions E130 or something and everyone is like HOLY $#@!. Then the community has to figure out how the new tag works. Same thing with transform tags, and plenty more I could find. And Noah isn't around quite as much anymore.


    These are super valuable to everyone. Having a Luminate developer actually look at the system and tell you what tags exist would be a really worthwhile task. Seriously, four new undocumented tags could be the best thing to happen here all year.


    I bet if you just posted a list of everything we could put in square brackets the community would backwards engineer them and write the docs themselves.
  • Colleen Gutierrez
    Colleen Gutierrez Blackbaud Employee
    Ancient Membership 10 Comments 25 Likes Photogenic
    Thanks, Brian.  We're looking into this!

Categories