D
D
Dmitry2017-03-07 15:45:40
MODX
Dmitry, 2017-03-07 15:45:40

Porting MODX EVO to REVO, a bug in the code?

Please help me with the following question.
There is a design that stopped working after the transfer from MODX EVO to REVO. It seems to have corrected the code, but something is still wrong. Changed Ditto to getResources and getTemplateVarOutput to GetObject, the PHP error is gone but the output is blank on the page.
There is code in the template responsible for displaying the schedule.

Chunk code:


Snippet code:
$today = date('l');
$image = $modx->getObject ( 'image', $id_vra4);
if($image['image'] =='') $image['image'] = здесь ссылка';
$need_id = $modx->getObject ( $today, $id_vra4);
foreach($need_id as $day=>$val)
{ if ($val !=='')
print '<dt></dt>
<dd>
  <span class="ico"><img width="50" align="left" style="margin-right:5px;" src="'.$image['image'].'" alt="" title="" /></span>
  <div class="name">
    <table cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="2">
        <a href="[[+id][~[+id+]~] title="[+pagetitle+]">[+pagetitle+]</a>
        </td>
        </tr>
        <tr><td>Сегодня</td><td class="time">'.$need_id[$today].'
      </td>
    </tr>
    </table>
  </div>
</dd>';
}

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
Dmitry Khristoev, 2017-03-07
@Dorofeevdima

- well, first of all, pdoResources is better, not getResources
- and this [~[+id+]~] should be changed to
- [+pagetitle+] to [[+pagetitle]]
- if in a chunk there is a TV, then you need to include TVs like for tvcategory - like &includeTVs =`tvcategory`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question