A
A
Andrey Eskov2017-07-12 13:15:47
1C-Bitrix
Andrey Eskov, 2017-07-12 13:15:47

Can you help me write a regular expression to change the pattern?

Dear help write a regular expression to change the template, I have been suffering for 2 hours.
It is necessary to change the template in the product card by clicking on the link and start printing.
That is, in the regular season you need to check that this is exactly the product card, and also look for a get parameter something like action=print
The option just with the yurl parameter does not fit, you need this action to work only in the product card.
My paths are /catalog/category/product/
I would be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2017-07-12
@taurus2790

If you are talking about a general site template - that is, a special condition - a parameter in the url: i.share.pho.to/ca5736ec_o.png
If you are talking about a component template, then I do not advise you to do this (editing through a visual editor will lead to loss).
Then it's better to check

($_REQUEST['param']=='value'? 'template1' : 'template2')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question