M
M
MaxKondratenko2015-06-18 15:43:12
1C-Bitrix
MaxKondratenko, 2015-06-18 15:43:12

Is it possible and how to use SITE_DIR correctly in the component path settings on 1s Bitrix?

For example, I have a complex Catalog component.
It has path settings:

"BASKET_URL" => "/site_oh/personal/cart/",
    "SEF_FOLDER" => "/site_oh/catalog/",
    "STORE_PATH" => "/site_oh/store/#store_id#",

"/site_oh/I tried to use the following instead SITE_DIR.", everything works until I open the settings of the complex component through the visual editor and save ... After such actions, everything that opens with the help of the complex component becomes unavailable.
The goal was simple, there is an online store with a bunch of franchises in different cities, they are all identical in appearance, but are in different folders, and, accordingly, the content of the info blocks is different, and so that in the future, when adding a new city, do not constantly pick the code or go into visual editor and not to manually change each path separately, I wanted to do it this way ... But apparently this can not be done? maybe there are other ways to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Misha Vasilyev, 2015-06-18
@vasilyev

The visual editor of Bitrix does not understand concatenation. But he will understand the so-called macro. And if you instead

"BASKET_URL" => SITE_DIR."/personal/cart/",
    "SEF_FOLDER" => SITE_DIR."/catalog/",
    "STORE_PATH" => SITE_DIR."/store/#store_id#",

will use
"BASKET_URL" => "#SITE_DIR#/personal/cart/",
    "SEF_FOLDER" => "#SITE_DIR#/catalog/",
    "STORE_PATH" => "#SITE_DIR#/store/#store_id#",

this whole structure should, in theory, work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question