D
D
Dmitry2017-03-21 20:42:52
MODX
Dmitry, 2017-03-21 20:42:52

How to remake the code after moving from modx evo to modx revo?

Please help me find the error. After transferring and editing the code, I can’t get it to work in any way.
There is a snippet for displaying working doctors for today's date. However, the output is empty.

<dl class="doctor_list">

</dl>

The snippet looks like this
<?php
$today = date('l');
$image = $modx->getObject('tv.image', $id_vra4);
if($image['tv.image'] =='') $image['tv.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['tv.image'].'" alt="" title="" /></span>
<div class="name">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<a href="" title=""></a>
</td>
</tr>
<tr><td>Сегодня</td><td class="time">'.$need_id[$today].'</td></tr>
</table>
</div>
</dd>';
}

And the getTitle2 function is like this:
$title = $modx->getObject($value, 1, 'pagetitle');
print $title['pagetitle'];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2017-03-21
@Dorofeevdima

1. Under Revo it is better to use pdoTools: https://docs.modx.pro/components/pdotools/
2. Use modifiers to match header:
https://docs.modx.com/revolution/2.x/making-sites- ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question