Not Displaying Imags by status or category? 
Posted: 17 October 2007 08:58 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  37
Joined  2006-12-07

I am using Gallery Extended to allow users to upload an image and associate it with a blog entry - that works- nice stuff..

The Challenge:
If the user uploads an image to a blog entry that is “open” we do not want the image to be displayed in that entry until we mark the images status to open. Currently the system is displaying the images even if they are closed. Here is the code.

{exp:gallery_extended:entries gallery_name="guide_images" related_id="{entry_id}" type="weblog" limit="1" category="4"}
{medium}
{
/exp:gallery_extended:entries}

We have tried using “category” to control which images are displayed - does not seem to effect it
The image status is closed but it is still displayed

Profile
 
 
Posted: 17 October 2007 02:22 PM   [ Ignore ]   [ # 1 ]
Jr. Member
RankRank
Total Posts:  37
Joined  2006-12-07

Problem Solved as follows:

It seems that “status” and “category” have no effect within the {gallery_extended} tag - at least I could not get them to effect anything.

So I:
1. Created a custom field for the weblog entry the gallery entry is related to and assign it either yes or no (drop down)
2. Wrap the {gallery_extended} tag with a conditional based on the custom weblog field as follows

{if logo_display == "yes"}
{exp
:gallery_extended:entries gallery_name="guide_images" related_id="{entry_id}" type="weblog" }
{medium}
{
/exp:gallery_extended:entries}
{
/if}

This allows us to view a logo or photo attached to an entry and approve it before it is displayed without effecting display of the entry itself…

Profile