1

I have a map and on this map are about 3 images. However the map displays different images on it every month. See code:

 <div class="col-sm-11 map">
                            {exp:channel:entries 
                                       channel="mapped" 
                                       status="open|Draft" 
                                       entry_id="1354"
                                       orderby="mapped_date" 
                                       sort="asc"}
                                <div id="container">
                                    {exp:channel_images:images field_id="336" entry_id="{entry_id}" category="included" limit="4"}
                                    <img data-x="{image:field:1}" data-y="{image:field:2}" src="{image:url}" />
                                    {/exp:channel_images:images}
                                </div>
                                    {/exp:channel:entries}

                                <div class="map-canvas">
                                    <img src="/images/picture1"/>
                                </div>
                            <div class="xsmall-pad"></div>
                            </div>

How do I specify that I want the images to only appear for a certain month - the title for that month is specified in the 3rd segment of the url. And how do I get the 3 images to overlap on top of the map?

0

You can access the values of URL segments with {segment_1}, {segment_2}, and so on.

{if "{segment_3}" == "january"}
     <h1>It's January!</h1>
{/if}

The segment_N syntax is available natively in EE; when you're ready to do more advanced things with URL segments, take a look at URL Helper.

| improve this answer | |
0

Was more complicated than I first laid it out to be. We had to create a plugin for it. No answer here because the solution specifically fixed a feature that is not found normally. But yes, Nick Benson's points on URL segments is valid.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.