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.

Noob question... I'm just not getting it, but I will :)

March 26, 2012 12:54pm

Subscribe [3]
  • #1 / Mar 26, 2012 12:54pm

    Myles Wakeham

    118 posts

    OK, I’m not sure if I’m approaching this correctly but let me explain what I’m trying to do.

    I have a site that I’m doing, and there is a home page (landing page) and follower pages coming from it.  On the home page, I have 3 column output and down the left and right columns I have small promotional blocks in addition to standard page navigation, etc.

    I have created a template for the home page, and I’m using Snippets for the promo blocks.  Basically there is a {promo1} type tag on the template in the appropriate place, to be replaced by the snippet code.

    In the snippet, I want to have both text & small graphic image.  But each Snippet is entirely different.  They are not like blog entries or channels in that they don’t share much in common at all.  I can do pure HTML for the snippet just fine, but when it comes to the image to show in there, I don’t want to have to FTP images from my dev machine to prod all the time because it would just be easier if I could do a File Upload through EE’s control panel, and let it do its magic with resizing, etc.

    I can do all of that, but how do I reference the image uploaded in the Files?  If it is in a channel, I get how to reference that.  But what if its not in a channel.  What if its just an uploaded image?  How do I reference that in my HTML for the snippet?

    Thanks in advance for any thoughts.

    Myles

  • #2 / Mar 26, 2012 1:20pm

    Andrew Fairlie

    126 posts

    Very good question.

    The snippet editor doesn’t have an upload image function and would require you to upload this separately.

    Channels would be the way to go with this I think, how different are we talking? You could possibly do some nice stuff within a channel field to make this work.

    Perhaps a field type called {fi_promo_html} where you write raw HTML and then in your template you can render it a little like:-

    {sn_promo_top}
    {fi_promo_html}
    {sn_promo_bottom}

    Within the channel you could have an image upload field ({fi_promo_image}) and then in your {fi_promo_html} you may be able to (could somebody confirmed this, I’ve never tried it) reference that like

    {fi_promo_image}

    It would certainly make it quite robust and elegant?

  • #3 / Mar 27, 2012 10:59am

    Shane Eckert

    7174 posts

    Hey Myles Wakeham,

    It looks like Andrew was able to help you out. That’s great. I like Andrews suggestion, it looks like a nice solution. Does it makes sense and do you think you could give that a go?

    If you need anything else, please let me know!

    Cheers,

  • #4 / Mar 27, 2012 1:54pm

    Myles Wakeham

    118 posts

    Yes, thanks for the followup.  Andrew was right on the money.  I found a way to do this, and was able to differentiate content for the left column vs. content for the right by using categories.  So I have this solved now and its working great.  Thanks to all for your kind suggestions.

    Myles

  • #5 / Mar 27, 2012 1:56pm

    Shane Eckert

    7174 posts

    Hey Myles,

    No problem! That’s what we are here for.

    Have a great week!!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases