Documentation

Special pages

Special pages can be specified in manifest when creating pages via wizard. For example, a shopping cart page. Special markers are envisaged for such pages, so that the page body can reference specific system data, without the knowledge of its full URL and even the ID.

If a corresponding page exists within the current site for such marker, the URL is substituted instead of the marker; otherwise the marker will be ignored.

Example

<a href="#system_cart">Shopping cart</a> 
//please note that the marker is specifically placed without the closing hash sign #

Presently, the following special page markers exist:

  • #system_mainpage – main page
  • #system_catalog – catalog main page
  • #system_personal – personal section
  • #system_cart – cart
  • #system_order – order processing
  • #system_payment – payment page (direct payment processing)
  • #system_compare – comparison page

Methods

Method Description Available from version
landing.syspage.set Set special page for site. When parameter lid is not passed, deletes a corresponding page type, not the page itself. Method returns nothing
BX24.callMethod(
   'landing.syspage.set',
   {
      id: 1390,// site ID
      type: 'personal',// page type
      lid: 8593// page ID, with specified type within the site
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
)
landing.syspage.get Method returns list of site pages, set a special pages.
BX24.callMethod(
   'landing.syspage.get',
   {
      id: 1390,// site ID
      active: true// When true, returns only active site pages (all pages by default)
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);
landing.syspage.getSpecialPage Returns URL of site special page. The example shows how to get a link to the page in the site's personal section.
BX24.callMethod(
   'landing.syspage.getSpecialPage',
   {
      siteId: 1391,// site ID
      type: 'personal',// special page type
      additional: {// optional array of additional parameters to be added to URL
         SECTION: 'private'
      }
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);
landing.syspage.deleteForLanding Method deletes all mentions of the page as a special page.
BX24.callMethod(
   'landing.syspage.deleteForLanding',
   {
      id: 8613 // page ID
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);
landing.syspage.deleteForSite Method deletes all the site special pages.
BX24.callMethod(
   'landing.syspage.deleteForSite',
   {
      id: 1391 // site ID
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);


© «Bitrix24», 2001-2024