On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Êîëëåãîç, ó ìåíÿ î÷åðåäíîé íåñòàíäàðòíûé âîïðîñ.

    Äàíî: ñîòíÿ-äðóãàÿ äîêóìåíòîâ, ó êàæäîãî èç êîòîðûõ åñòü òýã "êëþ÷", ïðè÷åì ïàðàìåòð ñîâïàäàåò íå áîëåå ÷åì ó 5-10 äîêóìåíòîâ, íå áîëåå. Ò.å. 5 äîê-òîâ "êèðïè÷", 7 äîê-òîâ "ëåäîêîë", 3 äîê-òà "äèçàéí" íó è äàëüøå â òîì æå äóõå. Ò.å. ìíîãî-ìíîãî ìàëåíüêèõ ãðóïï äîêóìåíòîâ ñ òýãàìè.

    Çàãâîçäêà: ïðîùå âñåãî áûëî áû ñäåëàòü îáëàêî òýãîâ, íî ÿ íèêîãäà íå õîæó ïðÿìûìè ïóòÿìè. Ìíå íóæíî íà ñòðàíèöàõ ýòèõ ñàìûõ äîêóìåíòîâ âûâåñòè ññûëêè íà äîêóìåíòû-ïîáðàòèìû.
    Ò.å. åñëè þçåð ñìîòðèò íà îäíó èç ñòðàíèö "êèðïè÷", òî â íóæíîì ìåñòå åìó ïîêàçûâàåòñÿ ñïèñîê ññûëîê íà âñå îñòàëüíûå ñòðàíèöû ñ òýãîì "êèðïè÷".
    Íàäåþñü, ÷òî ÿ íå ñëèøêîì çàïóòàííî îáúÿñíÿþ )))))

    Âîò. Ïîêà óìà íå ïðèëîæó êàê ýòî ñäåëàòü.
    Ìåíÿ õâàòèëî íà TV "òýã", è íà ýòîì èíæåíåðíîå ìûøëåíèå â ìîåé ãóìàíèòàðíîé áàøêå êëèíèò. Êàê âûâåñòè TV òîëüêî, åñëè åãî ñîäåðæèìîå ñîâïàäàåò ñ òåêóùèì - óìà íå ïðèëîæó smiley
    Õýëï? smiley
    • после продолжительных боев. сниппет обрел след черты морды лица

      вызов:
      [[SnippetName? &tmplvarname=`TVname` &docfield=`pagetitle`]]


      //ID of page for category links
      $pageid =  $modx->documentObject['id'];
      //Name of Template Variable used for relation
      $tmplvarname = isset($tmplvarname) ? $tmplvarname : "TVname";
      //related Document field for display as URL text
      $docfield = isset($docfield) ? $docfield : "introtext";
      
      // get TV value for current document
      $tmplvar = $modx->getTemplateVar($tmplvarname, '*', $pageid, 1);
      // find all documents with some TV value exept current document
      $sql = "SELECT * FROM ".$modx->db->config['dbase'].".".$modx->db->config['table_prefix']."site_tmplvar_contentvalues WHERE tmplvarid =".$tmplvar['id']." AND contentid <> ".$pageid." AND value='".trim($tmplvar['value'])."'";
      $rs = $etomite->dbQuery($sql);
      // fill output HTML
      $output = '<div><ul>';
      while($row = mysql_fetch_assoc($rs)){
      $a = $modx->getDocument($row['contentid'],$docfield);   
      $output .= "<li><a href='[~".$row['contentid']."~]'>".$a[$docfield]."</a></li>\n";
      }
      
      return $output."</ul></div>\n";
      
        "Und wenn du lange in einen Abgrund blickst, blickt der Abgrund auch in dich hinein."

        Не используйте Revo для "просто сайтов". Используйте Evo

        Who can defeat the Russian bear?
      • офигенно ))))