S
S
Stepan2016-02-08 12:38:14
MODX
Stepan, 2016-02-08 12:38:14

How to change TV value on click?

Resources have an additional field "ratingSort" Do you want the value of this parameter to change when the button on the page is clicked on the resource?

<?php
  $res = $modx->getObject('modResource',$id);
  $lst = $res->getTVValue('ratingSort');
  $res->setTVValue('ratingSort',$lst+1);
  $res->save();

Here is an example code that I want to execute, but I don’t know how to attach it to an event

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2016-02-08
@Sanes

Try it with get, example &limit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question