Forum

Thread tagged as: Problem, Field-Types

Repeater image issue

Hi,

I'm having issues when using the repeater tags on most of my templates. The images are not appearing but the rest of the content, like the text are. Help would be much appreciated because I can't see what I'm doing wrong! This is one of my templates:

<perch:repeater id="team" label="Fundraising/Trustee Team">
                            <div class="col-md-3 col-sm-6 bottommargin">

                            <div class="team">
                                <div class="team-image">
                                    <img src="<perch:content id="fundraiser" type="image" label="Image of Fundraising/Trustee Team Member" help="Please upload an image. Dimensions 400 x 300px">" alt="<perch:content type="text" label="Image description"/>">
                                </div>
                                <div class="team-desc">
                                    <div class="team-title"><h4><perch:content id="name" type="text" label="Name"/></h4><span><perch:content id="role" type="text" label="Role"/></span></div>

                                </div>
                            </div>

                        </div>
</perch:repeater>
Jade Marling

Jade Marling 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Your tags are malformed. This:

<perch:content id="fundraiser" type="image" label="Image of Fundraising/Trustee Team Member" help="Please upload an image. Dimensions 400 x 300px">

should be:

<perch:content id="fundraiser" type="image" label="Image of Fundraising/Trustee Team Member" help="Please upload an image. Dimensions 400 x 300px" />

I'm also having issues with this:

<perch:repeater id="slider" label="Slider"><li class="dark" data-transition="zoomout" data-slotamount="1" data-masterspeed="1500" data-thumb="images/slider/rev/bg1-thumb.jpg">
                    <!-- MAIN IMAGE -->
                     <img src="<perch:content id="slider-img" type="image" label="Image"/>"  alt="kenburns6"  />
                    <!-- LAYERS -->

                    <!-- LAYER NR. 1 -->




                    <div class="tp-caption customin ltl tp-resizeme revo-slider-caps-text uppercase"
                    data-x="0"
                    data-y="165"
                    data-customin="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
                    data-speed="800"
                    data-start="1000"
                    data-easing="easeOutQuad"
                    data-splitin="none"
                    data-splitout="none"
                    data-elementdelay="0.01"
                    data-endelementdelay="0.1"
                    data-endspeed="1000"
                    data-endeasing="Power4.easeIn" style="">Who We Are</div>

                    <div class="tp-caption customin ltl tp-resizeme revo-slider-emphasis-text nopadding noborder"
                    data-x="-3"
                    data-y="180"
                    data-customin="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
                    data-speed="800"
                    data-start="1200"
                    data-easing="easeOutQuad"
                    data-splitin="none"
                    data-splitout="none"
                    data-elementdelay="0.01"
                    data-endelementdelay="0.1"
                    data-endspeed="1000"
                    data-endeasing="Power4.easeIn" style="font-size: 56px;">Your National Charity</div>

                    <div class="tp-caption customin ltl tp-resizeme revo-slider-desc-text tleft"
                    data-x="0"
                    data-y="280"
                    data-customin="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
                    data-speed="800"
                    data-start="1400"
                    data-easing="easeOutQuad"
                    data-splitin="none"
                    data-splitout="none"
                    data-elementdelay="0.01"
                    data-endelementdelay="0.1"
                    data-endspeed="1000"
                    data-endeasing="Power4.easeIn" style="max-width: 550px; white-space: normal;">Wales Air Ambulance is an all Wales charity providing emergency
air cover for those who face life-threatening illness or injuries.</div>

                    <div class="tp-caption customin ltl tp-resizeme"
                    data-x="0"
                    data-y="385"
                    data-customin="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
                    data-speed="800"
                    data-start="1550"
                    data-easing="easeOutQuad"
                    data-splitin="none"
                    data-splitout="none"
                    data-elementdelay="0.01"
                    data-endelementdelay="0.1"
                    data-endspeed="1000"
                    data-endeasing="Power4.easeIn"><a href="about-us.php" class="button button-border button-white button-light button-large button-rounded tright nomargin"><span>View Details</span> <i class="icon-angle-right"></i></a></div>

                </li>
                </perch:repeater>
Simon Clay

Simon Clay 127 points

What issues are you having Jade?

Try changing your ID. Dashes shouldn't be used in IDs.

<perch:content id="slider-img" type="image" label="Image"/>

should be

<perch:content id="slider_img" type="image" label="Image"/>

Hi Simon, I have tried that thanks. The image isn't appearing for some reason. The slider work statically but when I put the image tag in the image won't appear.

Simon Clay

Simon Clay 127 points

Have you re-added the image after changing the ID?

Yes, I have

Simon Clay

Simon Clay 127 points

Can you enable debug on the page. https://docs.grabaperch.com/perch/configuration/debug/

Perhaps it will show where the issue lies.

This is the debug for the page

Debug Message
[8] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/jade/waa plus perch/index.php' OR regionPage='*' ORDER BY regionPage DESC
[8] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-11-25 14:49:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 8
[1] SELECT FOUND_ROWS() AS `count`
[35] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[8] Using template: \addons\apps\perch_blog\templates\blog\breaking-news.html
[2] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC
[3] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-11-25 14:49:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 3
[1] SELECT FOUND_ROWS() AS `count`
[3] Using template: \addons\apps\perch_blog\templates\blog\post_includes.html
[2] SELECT DISTINCT idx.itemID FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' AND ((idx.indexKey='_category' AND idx.indexValue LIKE 'blog/story-of-the-month/%' OR idx.indexKey='_category' AND idx.indexValue='blog/story-of-the-month/'))
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' AND idx.itemID IN ('2', '10') WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-11-25 14:49:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 1
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: \addons\apps\perch_blog\templates\blog\post_index.html
[1] SELECT DISTINCT e.* FROM perch2_events e WHERE eventDateTime>='2016-11-25' ORDER BY eventDateTime ASC LIMIT 1
[1] Using template: \addons\apps\perch_events\templates\events\listing\event-index.html
[nil] SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='2'
[1] SELECT DISTINCT e.* FROM perch2_events e WHERE eventDateTime>='2016-11-25' ORDER BY eventDateTime ASC LIMIT 5
[1] Using template: \addons\apps\perch_events\templates\events\listing\event-text-index.html
[nil] SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='2'

This is the admin debug

Debug Message
[1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='be25f14841d15084733f3edef98ebbe4' LIMIT 1
UPDATE perch2_users SET userHash='63967a5765ecfaf50dbd528c54636236' WHERE userID='1'
[79] SELECT p.privKey FROM perch2_user_privileges p
[35] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[1] SELECT * FROM perch2_content_regions WHERE regionID=103 LIMIT 1
[1] SELECT * FROM perch2_pages WHERE pageID='15' LIMIT 1
[1] SELECT * FROM perch2_content_items WHERE regionID=103 AND itemRev=6 ORDER BY itemOrder ASC
[1] SELECT * FROM perch2_content_items WHERE regionID=103 AND itemRev=6 ORDER BY itemOrder ASC
Using template: \templates\content\slider.html
Form not posted or did not validate
Queries: 9
Memory: 3.3066
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you view source on your page, can you see the image tag in the HTML?

Yes I can

Drew McLellan

Drew McLellan 2638 points
Perch Support

It sounds like the template is working then - you should double check your front end code.

The front end code is working, as the slider works until I add the perch tags in.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Then you should compare the working and the non-working version to see what's different.

Simon Clay

Simon Clay 127 points

Can you show your page code?