Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I am using nested pages so the user of a new site I am doing can add new pages and it's working all fine but I need to display info from another page on the home page

the home page url is index.php?p=5 and the shows page is index.php?p=6 and I need to get some info from the shows page and display it on the home page but unsure how to do that when using nested pages as masterpage does not seem to work with the p=6 part

The code I currently have is below

Code: Select all
<cms:pages masterpage='index.php?p=6' limit='3'>
                    <div class="news-block col-md-4 col-sm-6 col-xs-12">
                        <div class="inner-box wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="0ms">
                            <div class="image">
                                <div class="post-date"><cms:show shows_day/> <span><cms:show shows_month/></span></div>
                                <a href="show-details.php"><img src="<cms:show shows_image/>" alt="" /></a>
                            </div>
                            <div class="lower-content">
                                <h3><a href="show-details.php"><cms:show shows_name/></a></h3>
                                <a href="show-details.php" class="theme-btn read-more">Read More</a>
                            </div>
                        </div>
                    </div>
                </cms:pages>


Update: The code above is in a html file in the couchcms snippet folder

I did try the following on the above code but didn't work

Code: Select all
<cms:nested_pages masterpage='index.php' k_nestedpage_id='6' limit='3'>
                    <div class="news-block col-md-4 col-sm-6 col-xs-12">
                        <div class="inner-box wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="0ms">
                            <div class="image">
                                <div class="post-date"><cms:show shows_day/> <span><cms:show shows_month/></span></div>
                                <a href="show-details.php"><img src="<cms:show shows_image/>" alt="" /></a>
                            </div>
                            <div class="lower-content">
                                <h3><a href="show-details.php"><cms:show shows_name/></a></h3>
                                <a href="show-details.php" class="theme-btn read-more">Read More</a>
                            </div>
                        </div>
                    </div>
                    </cms:nested_pages>


It's just not getting the content from the nestedpage id 6 for some reason
Update: I managed to solve it using globals.php and set the editable parts in there, not sure why I didn't do that in the first place

Below is my code if it helps others

globals.php
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>

<cms:template name='globals' title='Shows' executable='0' order='10'>
   
<cms:repeatable name='shows_info' label='Shows Info' stacked_layout='1'>
<cms:editable name='shows_image' label='Shows Image' type='image' order='2' />
<cms:editable name='shows_day' label='Shows Day' type='text' order='3' />
<cms:editable name='shows_month' label='Shows Month' type='text' order='4' />
<cms:editable name='shows_name' label='Shows Name' type='text' order='5' />
<cms:editable name='shows_time' label='Shows Time' type='text' order='6' />
<cms:editable name='shows_location' label='Shows Location' type='text' order='7' />
<cms:editable name='shows_text' label='Shows Text' type='richtext' toolbar='full' order='8' />
</cms:repeatable>

</cms:template>

<?php COUCH::invoke(); ?>


In the snippets html file - I only put limit in as only want 3 to show on the home page
Code: Select all
<cms:pages masterpage='globals.php'>
                        <cms:show_repeatable 'shows_info' limit='3'>
                    <div class="news-block col-md-4 col-sm-6 col-xs-12">
                        <div class="inner-box wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="0ms">
                            <div class="image">
                                <div class="post-date"><cms:show shows_day/> <span><cms:show shows_month/></span></div>
                                <a href="show-details.php"><img src="<cms:show shows_image/>" alt="" /></a>
                            </div>
                            <div class="lower-content">
                                <h3><a href="show-details.php"><cms:show shows_name/></a></h3>
                                <a href="show-details.php" class="theme-btn read-more">Read More</a>
                            </div>
                        </div>
                    </div>
                        </cms:show_repeatable>
                    </cms:pages>
2 posts Page 1 of 1
cron