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.

How to best handle homepage feature image and text

September 20, 2007 10:24pm

Subscribe [2]
  • #1 / Sep 20, 2007 10:24pm

    Florian Fangohr

    20 posts

    Hello,

    I am new to ee and have a basic question:
    If I am trying to configure a homepage feature that is supposed to have an image and a caption does anybody know what the best way is to manage that?
    I already know how to add a custom image field to a web log entry and pull in the image from there, but wasn’t sure if this feature requires a whole new weblog to be set up, or if it can be handled differently. As far as requirements are concerned, it would be nice to be able to eventually randomly swap out different entries or at least have an archive of them to select from in the control panel.

    The site is for a group of documentary film makers and I have a web log set up, that is supposed to draw in a news feed underneath the main feature. The page is a complete skeleton right and I don’t know if looking at it helps but here it is: http://docfactory.fangohr.com/

    Does anybody have any pointers for me?

    Thanks in advance!

    Florian

  • #2 / Sep 21, 2007 8:23am

    e-man

    1816 posts

    As far as requirements are concerned, it would be nice to be able to eventually randomly swap out different entries or at least have an archive of them to select from in the control panel.

    I think you’ve answered your own question here. Either use a separate weblog with 2 fields: image and caption. Or use the gallery module for managing those images.

    The site is for a group of documentary film makers and I have a web log set up, that is supposed to draw in a news feed underneath the main feature. The page is a complete skeleton right and I don’t know if looking at it helps but here it is: http://docfactory.fangohr.com/

    Does anybody have any pointers for me?

    What pointers do you need regarding this?

  • #3 / Sep 21, 2007 11:38am

    Florian Fangohr

    20 posts

    Thanks for the answer e-man.
    The second part was just verbosity, not a separate question.

    Much appreciated.

    FF

  • #4 / Sep 21, 2007 1:18pm

    Florian Fangohr

    20 posts

    Hi,

    I just wanted to post what I ended up doing next for completeness’ sake.
    I have select homepage features, that consist of an image and a caption, with links in the captions and on the images. I took e-man’s advice and set up the gallery module.

    Then I created a category for every feature, like homepage_main_feature, and posted the image and caption inside. After which I looked for the corresponding catogory id (category=“2”) and entered that into the template and restricted the display of images to 1 (limit=“1”).

    The tag looks something like this:

    {exp:gallery:entries gallery="{gallery_name}" limit="1" columns="1" rows="2" category="2"}

    Now I can post multiple images into that category and the freshest one appears on the homepage, or I can choose to open or close images to show them manually. There also is a random option in the weblog module that gallery might support, will have to investigate.

    This is a first step, I might have to find another solution down the line, since some of the features might be flash video. And I think that would only work in a webblog set-up.

    I’ll probably post an update with the final solution.

    Still very new to EE and comments or tips are very much appreciated.

    Thanks,

    Florian

  • #5 / Sep 21, 2007 1:29pm

    e-man

    1816 posts

    There also is a random option in the weblog module that gallery might support, will have to investigate.

    That is one way of doing it so if it works for you then great.
    For random you’ll need orderby=“random”

    This is a first step, I might have to find another solution down the line, since some of the features might be flash video.

    I always use swfObject to embed Flash and just use a customfield {flash_code} with formatting set to “none” to embed the code.
    So put a script tag in the head of your page and then just add:

    <div id="flashcontent">
      This text is replaced by the Flash movie.
    </div>
    
    
       var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
       so.write("flashcontent");

    to your {flash_code} custom field. This works very well and of course you have all the options available as with the images.

  • #6 / Sep 21, 2007 4:02pm

    Florian Fangohr

    20 posts

    Great tips. I assume since the swfObject is using Javacript to rewrite the content of the DIV, so it will also work with the gallery module, right?

    I just wonder how I can put up .SWF files through the control panel, not so much for me but the client who will maintain the site afterwards.

    To other thing is that they want to switch between flash video files and images, and I am not sure of an easy way to do that. I am hoping that the swfObject script doesn’t write anything to the DIV if there is no URL defined, so showing images and no Flash could be possible. The other way around it doesn’t seem that easy because gallery requires there to be an image. The only way I can think right now would be to write a Javscript that hides the image if there is flash content, but even that isn’t a great fix since you still need to select an image in the gallery “new entry” section.

    I know it’s getting pretty specific now. Any insights into these problem?

    Cheers,

    Florian

  • #7 / Sep 21, 2007 4:18pm

    e-man

    1816 posts

    Have a look at conditional statements.

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

ExpressionEngine News!

#eecms, #events, #releases