Object Site: Overview of Methods
The Object Site allows you to create and configure various web pages: a company business card, an online store, and much more.
You can retrieve a list of all sites in Bitrix24 using the method landing.site.getList. To add a new site, use the method landing.site.add.
Quick navigation: all methods
Site Structure
Pages. They store the site's content. Managed by a group of methods landing.landing.*.
Folders. Optional. Used to group site pages and simplify navigation:
- create a new folder — method landing.site.addFolder,
- change folder parameters — method landing.site.updateFolder,
- get a list of all folders — method landing.site.getFolders.
User Documentation
Linking Sites to Other Objects
User. The site is linked to users by numerical identifiers in the parameters CREATED_BY_ID and MODIFIED_BY_ID. You can obtain the user ID using the method user.get.
Actions with Sites
Sites can be updated using the method landing.site.update. This method changes the title, description, homepage, color palette, and other parameters.
Site parameters can be exported to an array using the method landing.site.fullExport. The resulting array should then be used in the method landing.demos.register.
How to Publish Site Content
To make the site accessible, call the method landing.site.publication. After publication, the site receives a unique URL, which can be obtained using the method landing.site.getPublicUrl.
When you need to publish a specific folder, use the method landing.site.publicationFolder.
How to Unpublish a Site
You can unpublish:
- the entire site using the method landing.site.unpublic,
- a specific folder using the method landing.site.unPublicFolder,
- a specific page using the method landing.landing.unpublic.
How to Delete Folders and a Site
A specific folder can be moved to the trash using the method landing.site.markFolderDelete. If you need to move the entire site, use the method landing.site.markDelete. Deleted folders and sites can be restored using the methods landing.site.markFolderUnDelete and landing.site.markUnDelete within 30 days.
To delete a site without the possibility of recovery, use the method landing.site.delete. This will permanently destroy the site along with all folders and pages.
User Documentation
Site Permissions
Access permissions allow you to control who can view and modify the site's content. Permissions are granted only by the portal administrator. Two permission models are supported:
- role-based — permissions are configured using the method landing.role.setRights,
- extended — permissions are configured using the method landing.site.setRights.
You can determine the model using the method landing.role.isEnabled.
User Documentation
Overview of Methods
Scope:
landingWho can execute the method: any user
|
Method |
Description |
Available since |
|
Adds a site |
||
|
Adds a folder to the site |
21.800.0 |
|
|
Deletes a site |
||
|
Exports the site and all its pages into a special array |
||
|
Retrieves the site's folders |
21.800.0 |
|
|
Retrieves a list of sites |
||
|
Returns the preview image URL of the site |
21.800.0 |
|
|
Returns the full URL of the sites |
18.7.500 |
|
|
Retrieves additional fields of the site |
||
|
Marks the site as deleted |
||
|
Marks the folder as deleted |
21.800.0 |
|
|
Restores the folder from the trash |
21.800.0 |
|
|
Restores the site from the trash |
||
|
Publishes the site and all its pages |
||
|
Publishes the site's folder |
21.800.0 |
|
|
Unpublishes the site's folder |
21.800.0 |
|
|
Unpublishes the site and all its pages |
||
|
Updates site parameters |
||
|
Updates folder parameters |
21.800.0 |