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.

Trying to display an image

February 28, 2013 10:23am

Subscribe [1]
  • #1 / Feb 28, 2013 10:23am

    JayJ

    10 posts

    Hi there,

    I am trying to create a page that will display a bunch of graphical buttons, and depending on the language setting, the correct translated button image.

    I have created a Weblog that has an entry for each button, including information like:

    Title
    URL (where I want the button to go to)
    French Title
    French URL
    German Title
    German URL

    Here is the code I am struggling with:

    {exp:weblog:entries weblog="{my_buttons}" disable="categories|member_data|pagination|trackbacks"}
    
     /img/{title}{if country_code!=
     
    
    
    {/exp:weblog:entries}

    The ONLY thing that gets listed is the Alt text. In Firefox, you see the failed image box for a second before it is replaced by the Alt text.

    Rather than add extra fields in the weblog, I was hoping I could just use the {title} and just add the file extension to it? I’m not much of a developer, and so hoped that was doable. The reason why I wanted to use the {title} field was so that I could use it for the Alt field too. Plus my website can be seen in a few languages, and so rather than save button.png (English), button_fr.png (French) and button_de.png (German) in the weblog, I hoped to just use a bit of code.

    I can check the image is there and working by just doing:

    /img/videos.png

    And it works just fine, so I know the image is there and works.

    Any clues to where I am going horribly wrong?

  • #2 / Feb 28, 2013 12:01pm

    JayJ

    10 posts

    Ok… my {title} entry in the weblog was capitalised, and the files names were lower case…

    Is there a trick to making the contents of {title} lower case, whilst leaving the contents of the field be? I have simply added another field where I’ve placed the lower case word into, but was hoping for a more elegant solution - but needs must 😉

    Feel free to delete this post.

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

ExpressionEngine News!

#eecms, #events, #releases