How to add subpages to the home page only

dcistudios

Avatar: dcistudios

2009-05-05 17:43

Hi all, I am trying to add the subpages of a News section (cat 25) to my homepage, right underneath the left menu. Spent hours on this forum and could not find an answer. Any help would be greatly appreciated.

Using Quick.Cms.Lite v2.x

» Quick.Cms v2.x

treewood (OpenSolution)

Avatar: treewood

2009-05-06 07:11

edit templates/themes/default.php and paste:
$sLeftMenuPages = $oPage->listSubpages( 25, 'pages_news.tpl', 1 );

Create file 'templates/pages_news.tpl' and paste

<!-- BEGIN SUBPAGES_LIST_1 --><li class="l$aData[sStyle]"><h4><a href="$aData[sLinkName]">$aData[sName]</a></h4>$aData[sDescriptionShort]</li> <!-- END SUBPAGES_LIST_1 -->
<!-- 
BEGIN SUBPAGES_DESCRIPTION_1 --><h5>$aData[sDescriptionShort]</h5><!-- END SUBPAGES_DESCRIPTION_1 -->
<!-- 
BEGIN SUBPAGES_HEAD_1 --><ul class="leftMenu" id="subList1"><!-- END SUBPAGES_HEAD_1 -->
<!-- 
BEGIN SUBPAGES_FOOT_1 --></ul><!-- END SUBPAGES_FOOT_1 -->



In templates/container.tpl paste after $sMenu4 this: $sLeftMenuPages

Now you have to add some styles CSS to templates/plugins.css for class .leftMenu

dcistudios

Avatar: dcistudios

2009-05-06 08:07

Treewood. Thanks a bunch.

I would also need the news to appear ONLY on the homepage. Where and what "if" statement code to put. Thanks in advance.

cgan

Avatar: cgan

2009-05-07 13:30

dcistudios - try to use "pages_news.tpl" just for your home page and use "pages_default.tpl" for your other pages.

cgan

dcistudios

Avatar: dcistudios

2009-05-07 16:17

cgan...youre right, that will work. Tks

dcistudios

Avatar: dcistudios

2009-06-12 16:37

Hi Treewood,
Like my last post suggests, I only want the news to appear in the home page. However, when using $sLeftMenuPages in "pages_news.tpl" instead of container.tpl but nothing shows up. Any ideas to have the news appears on the home page only. THanks in advance.

Makaron

Avatar: Makaron

2009-06-15 07:45

You can make another theme for start page: http://opensolution.org/Quick.Cms/docs/?id=tips#themes_-_changing_design_of_all_page_on_particular_subpage
and load another block from container.tpl or even another file.

info@german-fight-company.de

Avatar: info@german-fight-company.de

2012-08-30 12:20

Hy, how does it work in v4? it looks like that the system dont use the template file page_news.tpl it uses the default list template from pages_default.tpl.

peace

Back to top
about us | contact