[en] Tip: How to make another type of displaying subpages like FAQ.

Makaron

Avatar: Makaron

2009-05-13 12:22

I prepared this tip for Quick.Cms.Lite but it can be used also in Quick.Cart.

Hello I want to show You how to make additional type of displaying subpages which You can use for build FAQ on Your site or whatever You want.
Here You can find ready example of this tip: http://www.portfolio.makaron.info.pl/projekty/Quick.Cms.Lite_v2.3_subpages_faq/?our-offer,3

Ok now what You have to do.. First You should edit file lang/xx.php and add next variable: $lang['Subpage_show_3'] it will be the name of our new type.
Next You have to edit file core/common-admin.php find function throwSubpagesShowSelect() and after line:

$aSubpages[2] = $GLOBALS['lang']['Subpage_show_2'];

add new one:

$aSubpages[3] = $GLOBALS['lang']['Subpage_show_3'];


Now change in file core/pages.php but it is optionally. I changed in function listSubpages() code:

if( $iType ){
   
$aData['sImage'] = $oTpl->tbHtml$sFile'SUBPAGES_NO_IMAGE_'.$iType );

for:

if( $iType && $iType != ){
   
$aData['sImage'] = $oTpl->tbHtml$sFile'SUBPAGES_NO_IMAGE_'.$iType );

because I don't want to display images in this type. When You want to display images You don't have to do anything.
Now we editing file actions_client/p.php line:

if( $aData['iSubpagesShow'] < )

for:

if( $aData['iSubpagesShow'] < )


In file templates/pages_default.tpl we have to add some blocks here there are:

<!-- BEGIN SUBPAGES_LIST_3 --><li class="l$aData[sStyle]"><h4>$aData[sName] <a href="#faq$aData[sStyle]" onclick="displaySubpage( 'faq$aData[sStyle]' );">+</a> <a href="#faq$aData[sStyle]" onclick="hideSubpage( 'faq$aData[sStyle]' );">-</a></h4>$aData[sDescriptionShort]</li><!-- END SUBPAGES_LIST_3 -->
<!-- 
BEGIN SUBPAGES_DESCRIPTION_3 --><h5 id="faq$aData[sStyle]">$aData[sDescriptionShort]</h5><!-- END SUBPAGES_DESCRIPTION_3 -->
<!-- 
BEGIN SUBPAGES_HEAD_3 --><ul class="subpagesList" id="subList1"><!-- END SUBPAGES_HEAD_3 -->
<!-- 
BEGIN SUBPAGES_FOOT_3 --></ul><!-- END SUBPAGES_FOOT_3 -->


In file plugins.css we have to add these two lines:

#subList1 li h5{display:none;}
#subList1 li h4 a{text-decoration:none;font-size:1.4em;}


And last thing we have to do is to add two functions in file core/plugins.js here there are:

function displaySubpagesBlockoObj ){
  var 
bCheck false;
  if( !
oObj ){
    var 
bCheck true;
  }
  if( 
gEBIsBlock ).style.display == 'block' && bCheck === true )
    
gEBIsBlock ).style.display 'none';
  else
    
gEBIsBlock ).style.display 'block';
// end function displayBlock

function hideSubpagesBlockoObj ){
  var 
bCheck false;
  if( !
oObj ){
    var 
bCheck true;
  }
  if( 
gEBIsBlock ).style.display == 'none' && bCheck === true )
    
gEBIsBlock ).style.display 'block';
  else
    
gEBIsBlock ).style.display 'none';
// end function displayBlock


When You make all these steps You should recieve new type like in example. I hope someone will enjoy it.

PS: Sorry for my english..

» Quick.Cart v3.x

grzdak

Avatar: grzdak

2011-12-26 17:19

Makaron, czy mógłbyś odświeżyć przykład? nie można podejrzeć do jakiego efektu dążymy.
Ja chciałabym wyświetlić subpages w dwóch kolumnach bez zdjęć i nie wiem czy to będzie to...
G

Makaron

Avatar: Makaron

2011-12-27 15:43

Proszę: http://www.mak-web.pl/projekty/Quick.Cms.Lite_v2.3_subpages_faq/?our-offer,3
Pamiętaj jednak, że to starsza wersja.

I helped? Like it: www.facebook.com/makwebpl

leendert12

Avatar: leendert12

2012-01-13 19:42

Hi Makaron, can this also be integrated in QC 4.2?

Makaron

Avatar: Makaron

2012-01-16 15:35

I don't know.. Just try. ;)

I helped? Like it: www.facebook.com/makwebpl

Back to top
about us | contact