'';
                  
                  
                  // Получаем ресурс по его id
                  
                  
                  $res = $modx->getObject('modResource',array('id'=>$id));
                  
                  
                  
                  
                  
                  // В зависимости от того, что нам нужно получаем то или иное значение
                  
                  
                  switch ($need) {
                  
                  
                    case "title": $output = $res->get('pagetitle'); break;
                  
                  
                    case "longtitle": $output = $res->get('longtitle'); break;
                  
                  
                    case "content": $output = $res->get('content'); break;
                  
                  
                    case "introtext": $output = $res->get('introtext'); break;
                  
                  
                    case "published": $output = $res->get('published'); break;
                  
                  
                  }
                  
                  
                  return $output;
                  
                  
                  и
                  
                  
                  <div class="section">
                  
                  
                      [[!FormIt?
                  
                  
                         &hooks=`editResource,redirect`
                  
                  
                         &validate=`title:required`
                  
                  
                         &redirectTo=`90`]]
                  
                  
                      <form action="[[~[[*id]]]]" method="post" class="form">
                  
                  
                          <input type="hidden" name="resId" id="resId" value="91" />
                  
                  
                          <label for="title">Заголовок:<br />
                  
                  
                           <span style="color: #cc0000;">[[!+fi.error.title]]</span><br />
                  
                  
                          </label>
                  
                  
                          <input type="text" name="title" id="title" value="[[!getContent? &need=`title` &id=`91`]]" /><br />
                  
                  
                          <label for="longtitle">Расширенный заголовок:<br /></label>
                  
                  
                          <input type="text" name="longtitle" id="longtitle" value="[[!getContent? &need=`longtitle` &id=`91`]]" /><br />
                  
                  
                          <input type="submit" value="Сохранить!" />
                  
                  
                      </form>
                  
                  
                  </div>
                  
                  
                  Подскажите, пожалуйста, как вывести во фронтенд кнопку публикации?
                  
                  
                
выведи селект 1|0 или checkbox
Обсуждают сегодня