Forum

Thread tagged as: Problem, Field-Types

Trouble selecting a single entry with perch_content_custom

Hi!

I'm trying to do something really simple and have gotten stuck. I basically just need to select a single entry based on it's slug, and have that display in a page. Derpy simple.

I've got this:

<?php include('perch/runtime.php'); ?>
<?php  $Q = perch_get('s');
    $p = perch_content_custom("Shows", array(
        "template" => "single-show.html",
        "skip-template" => true,
        "filter"   => "show-slug",
        "match"    => "eq",
        "value"    => $Q
    ));

    echo perch_get('s');

    var_dump($p);
?>

in a page called show.php sitting in the root folder. I've got skip_template in there for now for debugging.

If I remove all teh filtering I get all my records, so I know it works, and is selecting the right collection and all that. I can also see that all shows have a show-slug field.

When I add back the filtering it returns an empty array.

The collection(region?) has got "share across pages" switched on.

Any ideas? Thanks!

Ryan Cole

Ryan Cole 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Have you echoed the value of $Q to check it is the slug?

If you enable debug on that page what do you get?

Why do you have share across all pages? I'm not sure why that is relevant.

Hi Rachel! I actually started using Perch after hearing you on Jen's show :) Cool to see you in the forum!

Ya I've echoed it out and see that it's getting populated correctly.

I just switched on debugging, and here's what I get:


Debug Message SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Shows' AND (regionPage='/riyo_build/show.php' OR regionPage='*') SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=3 AND idx.itemRev=8)) AND ((idx.indexKey='show-slug' AND idx.indexValue='oklahoma')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID ORDER BY sortval ASC

Thanks for the help!!

I mention it being shared across pages, since when I go to the "pages" part in the admin panel, it says "Shared", and "home".

Basically what I'm trying to do is build a single page site with a modal that can be invoked to show a single item's details. So all the main info lives on this home page, but at the same time I want to be able to show a single record from that big list in more detail in a modal.

This page I'm trying to put together will be called by jquery and injected into a modal container. Maybe there's a better way to do this. :)

I think this is maybe all caused by me not really getting the difference between "allow multiple items" and the normal "single item" option.

Right now I have one "item" (a show) which contains many different shows. Is that the wrong way to go about this? I'm a bit confused as to the difference there. :/

Drew McLellan

Drew McLellan 2638 points
Perch Support

How is your template structured?

Hi Drew,

So I have a page show.php with this:

<?php include('perch/runtime.php'); ?>
<?php
    PerchSystem::set_var('current-slug', perch_get('s'));

    $p = perch_content_custom("Shows", array(
        "page" => "*",
        "template" => "_single-show.html",
        "skip-template" => true
        // "filter"   => "show-slug",
        // "match"    => "eq",
        // "value"    => perch_get('s'),
        // "count" => "1"
    ));

    echo "Query string: ".perch_get('s');

    echo "<br/><pre>";
    var_dump($p);
    echo "</pre>";

?>

<?php PerchUtil::output_debug(); ?>

and then my template, _single-show.html has this:


<perch:content id="current-slug" /> <perch:content id="show-is-active" type="checkbox" label="Show is Active" value="1" /> <perch:content id="show-is-featured" type="checkbox" label="Show is Featured in Slideshow" value="1" /> <perch:content id="show-image" type="image" label="Show Image" /> <article> <h3 class="modalTitle"> <perch:content id="show-title" type="text" label="Show Title" title="true" /> <i class="fa fa-times close"></i> </h3> <div class="slideShow"></div> <div class="description"> <span class="openDate"><perch:content id="show-open-date" type="date" label="Date of opening" /></span> <span class="show-finale-date"> <perch:content id="show-finale-date" type="date" label="Date of finale" /></span> <perch:content id="show-description" type="textarea" label="Show Description" /> </div> </article> <script> var fig = $('#showpage figure'); if (fig.length > 0){ $('#showpage').addClass('twoCol'); fig.detach().appendTo('#showpage .slideShow'); } else { $('#showpage').addClass('oneCol'); } </script>

The perch content tags at the top are me flailing about trying to figure out what's happening. :p

Basically now, when I remove the filter, I get all my shows, but with the filter on it returns nothing, and doesn't even inject the template.

The "Show" region is created on index.php, and looks like this:

<section id="repertoar" class="homeSection">
    <?php perch_content('Shows'); ?>
</section>

and that is using this template:

    <section class="inner_margin">
        <h2>Repertoar</h2>
        <svg class="horizontalDivider" width="100%" viewBox="0 0 633 20">
            <path d="M613.395,12.901L612.038,12.7995L610.681,12.5345L609.328,12.1484L607.966,11.6692L606.596,11.1193L605.213,10.517L602.482,9.25232L599.801,8.01132L598.537,7.46068L597.333,6.97762L596.215,6.58387L595.209,6.29692L594.349,6.12875L593.656,6.07693L592.963,6.12876L592.103,6.29693L591.096,6.58389L589.978,6.97764L588.774,7.46071L587.51,8.01133L584.83,9.25233L582.098,10.517L580.715,11.1193L579.345,11.6692L577.984,12.1484L576.63,12.5345L575.274,12.7995L573.917,12.9009L572.561,12.7995L571.205,12.5345L569.851,12.1484L568.49,11.6691L567.12,11.1192L565.737,10.517L563.006,9.25227L560.326,8.01128L559.062,7.46065L557.858,6.9776L556.74,6.58386L555.734,6.29691L554.874,6.12875L554.181,6.07693L553.488,6.12876L552.628,6.29693L551.621,6.5839L550.503,6.97766L549.299,7.46072L548.035,8.01135L545.354,9.25232L542.623,10.517L541.24,11.1193L539.87,11.6691L538.509,12.1484L537.155,12.5345L535.799,12.7995L534.443,12.9009L533.087,12.7995L531.73,12.5345L530.377,12.1484L529.016,11.6691L527.645,11.1193L526.262,10.517L520.851,8.01131L519.587,7.46068L518.383,6.97763L517.265,6.58388L516.259,6.29693L515.398,6.12876L514.705,6.07693L514.012,6.12875L513.152,6.29692L512.146,6.58387L511.028,6.97763L509.824,7.46069L508.56,8.01132L505.879,9.25231L503.148,10.517L501.765,11.1193L500.395,11.6691L499.034,12.1484L497.68,12.5345L496.324,12.7995L494.968,12.901L493.614,12.7991L492.269,12.5319L490.937,12.1427L489.605,11.6607L488.27,11.109L486.927,10.5063L484.27,9.24417L481.639,8.00821L480.388,7.46216L479.18,6.98263L478.04,6.59103L476.988,6.30354L476.047,6.13138L475.184,6.07268L474.766,6.08598L474.312,6.12749L473.246,6.30976L472.141,6.59818L470.975,6.98784L469.764,7.4637L468.527,8.00459L465.953,9.23454L463.379,10.4935L462.08,11.0966L460.784,11.6506L459.485,12.136L458.175,12.5288L456.843,12.7986L455.492,12.901L454.135,12.7995L452.779,12.5345L451.426,12.1483L450.065,11.6691L448.694,11.1192L447.312,10.517L444.581,9.2523L441.9,8.01132L440.636,7.46069L439.432,6.97763L438.314,6.58387L437.308,6.29692L436.448,6.12875L435.755,6.07693L435.062,6.12876L434.201,6.29694L433.195,6.5839L432.077,6.97765L430.873,7.4607L429.609,8.01133L424.197,10.517L422.814,11.1193L421.444,11.6692L420.083,12.1484L418.729,12.5345L417.373,12.7995L416.016,12.9009L414.66,12.7995L413.304,12.5345L411.95,12.1484L410.589,11.6691L409.219,11.1193L407.837,10.517L405.105,9.25232L402.425,8.01134L401.161,7.46072L399.957,6.97766L398.838,6.58391L397.832,6.29695L396.971,6.12876L396.278,6.07693L395.586,6.12875L394.725,6.2969L393.719,6.58385L392.601,6.97761L391.397,7.46067L390.134,8.0113L387.453,9.2523L384.722,10.517L383.339,11.1193L381.969,11.6691L380.608,12.1484L379.254,12.5345L377.898,12.7995L376.542,12.9009L375.186,12.7995L373.83,12.5345L372.476,12.1484L371.115,11.6691L369.744,11.1193L368.362,10.517L362.95,8.01133L361.686,7.4607L360.482,6.97764L359.364,6.58389L358.358,6.29693L357.497,6.12876L356.804,6.07693L356.111,6.12876L355.251,6.29693L354.245,6.58389L353.126,6.97764L351.922,7.46069L350.658,8.01132L347.978,9.2523L345.247,10.517L343.864,11.1192L342.494,11.6691L341.133,12.1484L339.779,12.5345L338.423,12.7995L337.067,12.901L335.713,12.7991L334.368,12.5319L333.036,12.1427L331.704,11.6607L330.369,11.109L329.026,10.5063L326.369,9.24415L323.738,8.00819L322.487,7.46214L321.28,6.9826L320.14,6.59101L319.087,6.30352L318.147,6.13138L317.284,6.07268L316.866,6.08598L316.412,6.12749L315.345,6.30977L314.24,6.5982L313.075,6.98786L311.863,7.46371L310.626,8.0046L308.052,9.23454L305.478,10.4935L304.179,11.0966L302.883,11.6506L301.584,12.136L300.275,12.5288L298.943,12.7986L297.592,12.901L296.235,12.7995L294.879,12.5345L293.525,12.1484L292.164,11.6691L290.794,11.1193L289.411,10.517L283.999,8.01132L282.735,7.46069L281.531,6.97763L280.413,6.58388L279.407,6.29692L278.547,6.12875L277.854,6.07693L277.161,6.12876L276.301,6.29693L275.295,6.58388L274.176,6.97763L272.972,7.46069L271.709,8.01132L269.028,9.25232L266.296,10.517L264.914,11.1193L263.543,11.6692L262.182,12.1484L260.828,12.5345L259.472,12.7995L258.115,12.9009L256.759,12.7995L255.403,12.5345L254.049,12.1484L252.688,11.6691L251.318,11.1192L249.935,10.517L247.204,9.25227L244.524,8.01128L243.26,7.46065L242.056,6.9776L240.938,6.58386L239.932,6.29691L239.072,6.12875L238.379,6.07693L237.686,6.12876L236.826,6.29694L235.819,6.5839L234.701,6.97765L233.497,7.46071L232.233,8.01134L229.552,9.25233L226.821,10.517L225.438,11.1193L224.068,11.6691L222.707,12.1484L221.353,12.5345L219.997,12.7995L218.641,12.9009L217.285,12.7995L215.928,12.5345L214.575,12.1484L213.214,11.6691L211.843,11.1193L210.46,10.517L207.729,9.2523L205.049,8.01131L203.785,7.46068L202.581,6.97763L201.463,6.58388L200.457,6.29693L199.596,6.12876L198.903,6.07693L198.21,6.12875L197.35,6.29692L196.344,6.58388L195.226,6.97763L194.022,7.46069L192.758,8.01132L190.077,9.25231L187.346,10.517L185.963,11.1193L184.593,11.6691L183.232,12.1484L181.878,12.5345L180.522,12.7995L179.165,12.901L177.812,12.7991L176.467,12.5319L175.135,12.1427L173.803,11.6607L172.468,11.109L171.125,10.5063L168.468,9.24415L165.837,8.00819L164.586,7.46214L163.379,6.9826L162.239,6.59101L161.186,6.30352L160.246,6.13138L159.383,6.07268L158.965,6.08598L158.511,6.12749L157.444,6.30977L156.339,6.5982L155.174,6.98786L153.962,7.46371L152.725,8.0046L150.151,9.23455L147.577,10.4935L146.278,11.0966L144.982,11.6506L143.683,12.136L142.374,12.5288L141.042,12.7986L139.691,12.901L138.334,12.7995L136.978,12.5345L135.624,12.1484L134.263,11.6691L132.893,11.1193L131.51,10.517L126.098,8.01132L124.834,7.46069L123.63,6.97763L122.512,6.58388L121.506,6.29692L120.646,6.12875L119.953,6.07693L119.26,6.12876L118.4,6.29693L117.394,6.58388L116.275,6.97763L115.071,7.46068L113.808,8.01132L111.127,9.25232L108.395,10.517L107.013,11.1193L105.642,11.6692L104.281,12.1484L102.927,12.5345L101.571,12.7995L100.214,12.9009L98.8578,12.7995L97.5019,12.5345L96.1484,12.1484L94.7875,11.6691L93.417,11.1192L92.0347,10.517L89.3032,9.2523L86.6228,8.01132L85.3589,7.46069L84.1549,6.97764L83.0367,6.58389L82.0306,6.29693L81.1701,6.12876L80.4771,6.07693L79.7843,6.12875L78.924,6.29691L77.918,6.58387L76.7999,6.97762L75.5959,7.46067L74.3321,8.01131L71.6518,9.2523L68.9202,10.517L67.5378,11.1193L66.1672,11.6691L64.8062,12.1484L63.4525,12.5345L62.0965,12.7995L60.7401,12.9009L59.3838,12.7995L58.0279,12.5345L56.6743,12.1484L55.3134,11.6691L53.9428,11.1193L52.5604,10.517L49.8287,9.25233L47.1482,8.01134L45.8842,7.46071L44.6801,6.97765L43.5618,6.5839L42.5557,6.29694L41.6951,6.12876L41.0021,6.07693L40.3091,6.12876L39.4486,6.29693L38.4425,6.58389L37.3243,6.97764L36.1203,7.46069L34.8564,8.01132L32.176,9.2523L29.4445,10.517L28.0622,11.1192L26.6917,11.6691L25.3308,12.1484L23.9773,12.5345L22.6214,12.7995L21.2645,12.901L19.9109,12.7991L18.5665,12.5319L17.2339,12.1427L15.9025,11.6607L14.5672,11.109L13.2239,10.5063L10.5669,9.24415L7.93646,8.00819L6.68518,7.46214L5.47774,6.9826L4.33773,6.59101L3.28548,6.30352L2.3447,6.13138L1.35859,6.06427L1.6956,1.11173L2.96192,1.1979L4.38838,1.45891L5.7997,1.8445L7.20114,2.3259L8.59456,2.87929L9.9851,3.48612L12.6873,4.75585L15.3051,5.99936L16.5315,6.54957L17.696,7.03077L18.7761,7.42176L19.7483,7.70568L20.5835,7.87166L21.2657,7.92302L21.9578,7.87125L22.8182,7.70308L23.8242,7.41613L24.9423,7.02238L26.1463,6.53933L27.4101,5.98869L30.0904,4.7477L32.822,3.48299L34.2044,2.88074L35.575,2.33086L36.936,1.85162L38.2897,1.46551L39.6457,1.20051L41.0021,1.09907L42.3585,1.20051L43.7145,1.4655L45.0683,1.85161L46.4293,2.33085L47.8,2.88072L49.1825,3.48297L51.9142,4.74767L54.5947,5.98867L55.8587,6.53931L57.0627,7.02237L58.1809,7.41612L59.1869,7.70308L60.0473,7.87125L60.7401,7.92307L61.4331,7.87124L62.2936,7.70307L63.2997,7.41611L64.4179,7.02236L65.6219,6.53931L66.8858,5.98868L69.5662,4.7477L72.2977,3.483L73.68,2.88076L75.0505,2.33088L76.4114,1.85164L77.7649,1.46552L79.1208,1.20052L80.4771,1.09907L81.8335,1.20051L83.1895,1.46551L84.5432,1.85162L85.9042,2.33086L87.2748,2.88074L88.6572,3.48299L91.3888,4.7477L94.0691,5.98869L95.3329,6.53933L96.5369,7.02238L97.655,7.41613L98.661,7.70308L99.5213,7.87125L100.214,7.92307L100.907,7.87123L101.768,7.70304L102.775,7.41608L103.893,7.02233L105.097,6.53928L106.361,5.98866L109.042,4.74768L111.773,3.48299L113.155,2.88074L114.526,2.33087L115.887,1.85163L117.241,1.46551L118.597,1.20052L119.953,1.09907L121.309,1.20052L122.665,1.46552L124.019,1.85163L125.38,2.33087L126.75,2.88074L128.133,3.48299L133.545,5.98868L134.809,6.53931L136.013,7.02237L137.131,7.41612L138.137,7.70308L138.997,7.87125L139.689,7.92297L140.359,7.87214L141.165,7.70878L142.099,7.42854L143.137,7.04093L144.257,6.56198L145.442,6.01218L147.99,4.76545L150.66,3.48971L152.06,2.87772L153.478,2.32064L154.924,1.83731L156.398,1.45266L157.866,1.20178L158.66,1.12917L159.473,1.10332L160.863,1.1979L162.289,1.45891L163.701,1.8445L165.102,2.3259L166.496,2.87929L167.886,3.48612L170.588,4.75585L173.206,5.99936L174.432,6.54957L175.597,7.03077L176.677,7.42176L177.649,7.70568L178.484,7.87166L179.167,7.92302L179.859,7.87125L180.719,7.70308L181.725,7.41612L182.843,7.02237L184.047,6.53931L185.311,5.98868L187.992,4.74769L190.723,3.48299L192.106,2.88074L193.476,2.33087L194.837,1.85163L196.191,1.46552L197.547,1.20052L198.903,1.09907L200.26,1.20052L201.615,1.46551L202.969,1.85163L204.33,2.33087L205.701,2.88075L207.083,3.483L209.815,4.7477L212.495,5.98868L213.759,6.5393L214.963,7.02235L216.081,7.4161L217.087,7.70306L217.948,7.87124L218.641,7.92307L219.334,7.87125L220.194,7.70308L221.2,7.41612L222.318,7.02237L223.523,6.53931L224.786,5.98867L227.467,4.74767L230.199,3.48297L231.581,2.88072L232.952,2.33085L234.313,1.85161L235.667,1.4655L237.023,1.20051L238.379,1.09907L239.735,1.20052L241.091,1.46553L242.445,1.85165L243.806,2.3309L245.176,2.88078L246.558,3.48303L249.29,4.74773L251.97,5.98871L253.234,6.53933L254.438,7.02238L255.556,7.41612L256.562,7.70307L257.422,7.87124L258.115,7.92307L258.808,7.87123L259.669,7.70304L260.676,7.41607L261.794,7.02233L262.998,6.53928L264.262,5.98866L266.943,4.74768L269.674,3.48299L271.057,2.88074L272.427,2.33087L273.788,1.85163L275.142,1.46551L276.498,1.20052L277.854,1.09907L279.21,1.20052L280.566,1.46552L281.92,1.85163L283.281,2.33087L284.651,2.88074L286.034,3.48299L291.446,5.98868L292.71,6.53931L293.914,7.02237L295.032,7.41612L296.038,7.70308L296.898,7.87125L297.59,7.92297L298.26,7.87214L299.066,7.70878L300,7.42854L301.038,7.04093L302.158,6.56197L303.343,6.01218L305.891,4.76546L308.561,3.48971L309.961,2.87772L311.379,2.32064L312.825,1.83731L314.299,1.45266L315.767,1.20178L316.561,1.12917L317.374,1.10332L318.764,1.1979L320.19,1.45891L321.602,1.8445L323.003,2.3259L324.397,2.87929L325.787,3.48612L328.489,4.75585L331.107,5.99936L332.333,6.54957L333.498,7.03077L334.578,7.42176L335.55,7.70568L336.385,7.87166L337.068,7.92302L337.76,7.87125L338.62,7.70308L339.626,7.41613L340.744,7.02238L341.948,6.53933L343.212,5.9887L345.892,4.7477L348.624,3.48299L350.006,2.88074L351.377,2.33086L352.738,1.85162L354.092,1.46551L355.448,1.20051L356.804,1.09907L358.161,1.20052L359.517,1.46551L360.87,1.85162L362.231,2.33086L363.602,2.88073L364.984,3.48299L370.396,5.98867L371.66,6.5393L372.864,7.02236L373.982,7.41611L374.989,7.70307L375.849,7.87124L376.542,7.92307L377.235,7.87125L378.095,7.70308L379.101,7.41612L380.219,7.02237L381.423,6.53932L382.687,5.98869L385.368,4.7477L388.099,3.48301L389.481,2.88076L390.852,2.3309L392.213,1.85165L393.566,1.46553L394.922,1.20053L396.278,1.09907L397.635,1.20051L398.991,1.46549L400.345,1.8516L401.706,2.33084L403.076,2.88071L404.459,3.48297L407.191,4.74768L409.871,5.98869L411.135,6.53932L412.339,7.02238L413.457,7.41613L414.463,7.70308L415.323,7.87125L416.016,7.92307L416.709,7.87124L417.57,7.70306L418.576,7.4161L419.694,7.02235L420.898,6.5393L422.162,5.98867L427.574,3.48298L428.957,2.88073L430.328,2.33085L431.689,1.8516L433.042,1.46549L434.399,1.20051L435.755,1.09907L437.111,1.20052L438.467,1.46552L439.821,1.85163L441.182,2.33087L442.552,2.88074L443.935,3.483L446.666,4.7477L449.347,5.9887L450.61,6.53934L451.814,7.02239L452.932,7.41615L453.938,7.7031L454.799,7.87125L455.49,7.92297L456.16,7.87214L456.967,7.70876L457.901,7.42851L458.938,7.0409L460.059,6.56195L461.243,6.01217L463.792,4.76546L466.462,3.48973L467.861,2.87773L469.28,2.32066L470.725,1.83733L472.199,1.45268L473.667,1.20179L474.461,1.12918L475.274,1.10332L476.664,1.19789L478.091,1.4589L479.502,1.84448L480.904,2.32587L482.297,2.87927L483.688,3.4861L486.39,4.75583L489.008,5.99935L490.234,6.54957L491.399,7.03076L492.479,7.42175L493.451,7.70568L494.286,7.87166L494.969,7.92302L495.661,7.87125L496.521,7.70308L497.527,7.41612L498.645,7.02237L499.849,6.53931L501.113,5.98867L503.794,4.74769L506.525,3.48299L507.908,2.88074L509.278,2.33087L510.639,1.85163L511.993,1.46552L513.349,1.20052L514.705,1.09907L516.062,1.20052L517.417,1.46551L518.771,1.85162L520.132,2.33087L521.503,2.88075L522.885,3.48301L528.297,5.98868L529.561,6.5393L530.765,7.02236L531.883,7.4161L532.889,7.70306L533.75,7.87124L534.443,7.92307L535.136,7.87125L535.996,7.70308L537.002,7.41613L538.12,7.02237L539.325,6.5393L540.588,5.98867L543.269,4.74768L546.001,3.48297L547.383,2.88071L548.754,2.33084L550.115,1.85161L551.469,1.4655L552.825,1.20051L554.181,1.09907L555.537,1.20052L556.893,1.46553L558.247,1.85165L559.608,2.3309L560.978,2.88078L562.36,3.48303L565.092,4.74773L567.772,5.98871L569.035,6.53932L570.24,7.02238L571.358,7.41612L572.364,7.70307L573.224,7.87124L573.917,7.92307L574.61,7.87124L575.471,7.70305L576.477,7.41609L577.596,7.02234L578.8,6.53928L580.064,5.98865L582.744,4.74767L585.476,3.48298L586.858,2.88072L588.229,2.33086L589.59,1.85162L590.944,1.4655L592.3,1.20052L593.656,1.09907L595.012,1.20052L596.368,1.46552L597.722,1.85164L599.083,2.33088L600.453,2.88075L601.836,3.48299L604.567,4.74768L607.248,5.98866L608.512,6.53928L609.716,7.02234L610.834,7.41609L611.84,7.70305L612.701,7.87124L613.393,7.92297L614.062,7.87215L614.869,7.70881L615.802,7.42858L616.839,7.04097L617.96,6.562L619.144,6.0122L621.693,4.76546L624.363,3.4897L625.763,2.87771L627.181,2.32063L628.627,1.83731L630.101,1.45266L631.569,1.20178L632.363,1.12917L633.052,1.10725L633.21,6.06875L632.668,6.08598L632.214,6.12749L631.147,6.30978L630.042,6.5982L628.877,6.98787L627.665,7.46372L626.428,8.00461L623.854,9.23454L621.28,10.4935L619.981,11.0966L618.685,11.6505L617.387,12.1359L616.077,12.5288L614.746,12.7986L613.395,12.901Z" style="fill:rgb(255,83,128);"/>
        </svg>
        <ul class="shows activeShows flexy">
            <perch:repeater id="show_active" label="A single show">
                <perch:content id="show-is-active" type="checkbox" label="Show is Active" value="1" suppress="true" />
                <perch:content id="show-is-featured" type="checkbox" label="Show is Featured in Slideshow" value="1" suppress="true" />
                <perch:content id="show-open-date" type="date" label="Date of opening" suppress="true" />
                <perch:content id="show-finale-date" type="date" label="Date of finale" suppress="true" />
                <perch:if exists="show-is-active">
                <li class="show">
                    <figure>
                        <div class="showThumb">
                            <a href="/riyo_build/show.php?s=<perch:content id="show-slug" type="slug" for="show-title"/>">
                                <img src="<perch:content id="show-image" type="image" label="Show Image" />" alt=""/>
                            </a>
                        </div>
                        <figcaption>
                            <h4>
                                <a href="/riyo_build/show.php?s=<perch:content id="show-slug" type="slug" for="show-title"/>">
                                    <perch:content id="show-title" type="text" label="Show Title" title="true" />
                                </a>
                            </h4>
                            <p>
                                <perch:content id="show-description" type="textarea" label="Show Description" />
                            </p>
                        </figcaption>
                    </figure>
                </li>
            </perch:if>
            </perch:repeater>
        </ul>
    </section>
    <div class="inactiveButtonWrapper">
        <button class="showInactiveShows">
            <span>Show all Shows</span><i class="fa fa-refresh fa-spin"></i>
        </button>
    </div>
    <div class="inactiveSection">
        <div class="fadeOverlay"></div>
        <section class="inner_margin">
            <ul class="flexy shows inactiveshows">
                <perch:repeater id="show_inactive" label="A single show" />
                <perch:if not-exists="show-is-active">
                <li class="show">
                    <figure>
                        <div class="showThumb">
                            <img src="<perch:content id="show-image" type="image" label="Show Image" />" alt=""/>
                        </div>
                        <figcaption>
                            <h4>
                                <perch:content id="show-title" type="Text" label="Show Title" />
                            </h4>
                            <p>
                                <perch:content id="show-description" type="Text" label="Show Description" />
                            </p>
                        </figcaption>
                    </figure>
                </li>
            </perch:if>
            </perch:repeater>
            </ul>
        </section>
    </div>
</section>

Thanks for any help you can offer!!

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you add <perch:showall /> to your template, can you see the show-slug properly populated?

How much content do you currently have? I ask because all your IDs are invalid and I'm wondering how much work it would be to correct them.

ha! I figured it was something fundamental like that. :p What constitutes a valid field ID? I assume it's the - that wrecks it?

I have literally about 4 records so that's not an issue at all. I'll try the showall thing and report back.

ya weirdly enough it looks like it's populated. :/

Array
(
    [0] => Array
        (
            [show-is-active] => 1
            [show-is-featured] => 
            [show-open-date] => 2015-09-07
            [show-finale-date] => 2015-09-07
            [show-slug] => oklahoma
            [show-image] => Array
                (
                    [assetID] => 9
                    [title] => Oklahoma Poster
                    [_default] => /riyo_build/perch/resources/oklahoma-poster.png
                    [bucket] => default
                    [path] => oklahoma-poster.png
                    [size] => 361105
                    [w] => 806
                    [h] => 1247
                    [mime] => image/png
                    [sizes] => Array
                        (
                            [thumb] => Array
                                (
                                    [w] => 96
                                    [h] => 150
                                    [target_w] => 150
                                    [target_h] => 150
                                    [density] => 2
                                    [path] => oklahoma-poster-thumb@2x.png
                                    [size] => 81955
                                    [mime] => 
                                    [assetID] => 10
                                )

                        )

                )

            [show-title] => Oklahoma
            [_title] => Oklahoma
            [show-description] => Array
                (
                    [_flang] => plain
                    [raw] => This is a descripton for show call Oklahoma. It's a story about the first settlers in the new west.
                    [processed] => This is a descripton for show call Oklahoma. It's a story about the first settlers in the new west.
                )

        )

    [1] => Array
        (
            [show-is-active] => 1
            [show-is-featured] => 
            [show-open-date] => 2015-09-08
            [show-finale-date] => 2015-09-08
            [show-slug] => hairspray
            [show-image] => Array
                (
                    [assetID] => 5
                    [title] => Hairspray show poster
                    [_default] => /riyo_build/perch/resources/hairspray-show-poster.jpg
                    [bucket] => default
                    [path] => hairspray-show-poster.jpg
                    [size] => 1783189
                    [w] => 2550
                    [h] => 3300
                    [mime] => image/jpeg
                    [sizes] => Array
                        (
                            [thumb] => Array
                                (
                                    [w] => 115
                                    [h] => 150
                                    [target_w] => 150
                                    [target_h] => 150
                                    [density] => 2
                                    [path] => hairspray-show-poster-thumb@2x.jpg
                                    [size] => 27345
                                    [mime] => 
                                    [assetID] => 6
                                )

                        )

                )

            [show-title] => hairspray
            [_title] => hairspray
            [show-description] => Array
                (
                    [_flang] => plain
                    [raw] => desc desc
                    [processed] => desc desc
                )

        )

)

I've now removed all the dashes from the field IDs and still no jazz. :(

AHH ok so I restructured this a bit and I think it comes down to having a <perch:repeater> in the template that I used to define the regions' fields.

I had it like this originally because of how things are to be displayed on the site.

So now the template linked with the region that defines the "model" for the region is almost only perch field tags. Then I'm using Content Custom to actually show the content on the page.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok - so is it working?

ya it is now. I ended up dumping the whole DB a few times before getting it right.

I had not really understood that the repeater was for repeating something inside of a single entry record. I had been making my entire list of shows inside of one record w/ a repeater. :O

I'll just RTFM a little better next time. Loving Perch though!