We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Displaying content of multiple pages into home page

Hi All ,

In my website , there is a section of case study . I have created multiple pages for case study .

Right now I'm trying to display on my homepage the 3 latest case studies . Just like how we do for perch collections .

So , my main page / Home Page has a section like below .

<section class="news-section-three">
    <div class="auto-container">
        <!--Sec Title-->
        <div class="sec-title centered">
            <h2>Latest zemen News</h2>
            <div class="title-text">Automate & Simplify The Whole Process</div>
        </div>
        <div class="row clearfix">
            <?php
  perch_content_custom('CaseStudy', [
    'page'=>'/case-study',
    'template'=>'_case-study-main.html',
    'sort'=>'date',
    'sort-order'=>'DESC',
    'count'=>1
  ]);
?>

        </div>
    </div>
</section>

Which inturn display the template from this

                <!--News Block Three-->
                <div class="news-block-three col-lg-4 col-md-6 col-sm-12">
                    <div class="inner-box wow fadeInLeft" data-wow-delay="0ms" data-wow-duration="1500ms">
                        <div class="image">
                            <a href="blog-single.html"><img src="<perch:content type="image" id="Case_Study_BG_image" label="Case_Study_BG_image">" alt="" /></a>
                        </div>
                        <div class="lower-content">
                            <ul class="post-info">
                                <li><perch:content  id="Case_Study_H1" label="Case_Study_H1" type="text"/></li>
                            </ul>
                            <h3><a href="blog-single.html"><perch:content  id="Case_Study_H1" label="Case_Study_H1" type="text"/></a></h3>
                            <a class="read-more" href="blog-single.html"><span class="fa fa-angle-right"></span> Read more</a>
                        </div>
                    </div>
                </div>
Titus Saju

Titus Saju 0 points

  • 6 months ago

all the reference i used in _case-study-main.html are the same tags that i used to create the pages under case study

my Case Study Page looks like this .

<?php if (!defined('PERCH_RUNWAY')) include($_SERVER['DOCUMENT_ROOT'].'/missan/perch/runtime.php'); ?>
<!DOCTYPE html>
<html>
<!-- ============================ Header ============================ -->
<?php
perch_layout('global/header', array(
));
?>
<!-- ============================ Header ============================ -->
<body style="overflow-x:hidden">


    <!-- Preloader 
    <div class="preloader"></div>
    -->
    <!-- Main Header-->
    <?php
perch_layout('global/navigation-main', array(
));
?>
    <!--End Main Header -->

    <!--========================================= MY REGION ============================================== -->

     <?php perch_content('CaseStudy'); ?>

    <!--========================================= MY REGION ============================================== -->



    <!--Call To Action Section-->
    <div class="call-to-action-section">
        <div class="outer-container">
            <div class="clearfix">

                <!--Left Column-->
                <div class="left-column clearfix">
                    <div class="image-layer" style="background-image: url(images/background/1.jpg)"></div>
                    <div class="inner-column">
                        <h2>We help you to unlock & unleash the power <br> within your large scale Business</h2>
                    </div>
                </div>

                <!--Right Column-->
                <div class="right-column">
                    <div class="inner-column">
                        <a href="#" class="theme-btn btn-style-four">Book a Consultation</a>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <!--End Call To Action Section-->

 <?php
perch_layout('global/footer', array(
));
?>
</div>
</body>
</html>
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Titus,

It's not very clear what you need help with.

Right now I'm trying to display on my homepage the 3 latest case studies . Just like how we do for perch collections .

Are you having trouble listing more than one case study on the home page?