Multilist mit Unterkategorien

Wie verwendet man Module oder Aktion und passt diese an.

Multilist mit Unterkategorien

Beitragvon acanzo » 22. Okt 2008, 10:01

Hallo redaxo-Gemeinde,

ich habe mich mal an das Problem Teaser mit Eionbeziehung der Unterkategorien gemacht.

Im Bereich Ausgabe des Moduls Multilist habe ich ab Zeile 152 folgenden Code eingefügt bzw. geändert

Code: Alles auswählen
   
// Artikel aus Unter-Kategorie lesen

$mainCat = REX_VALUE[1];
$cat = OOCategory::getCategoryById($mainCat);
$children = $cat->getChildren();
   
// Temp Array für alle Artikel Objects erstellen

foreach ($children AS $child) {
   $catId = $child->getId();
   $articles = OOArticle::getArticlesOfCategory($catId, true);
   $articlestemp[] = $articles;
}

$articles = OOArticle::getArticlesOfCategory('REX_VALUE[1]', true); //Originalcode
$articlestemp[] = $articles;
$articles = $articlestemp;


Er durchläuft schön die Unterkategorien

Wenn ich mir $articlestemp mit print_r ausgeben lassen, sieht das wie folgt aus:



Code: Alles auswählen
2425262736Array ( [0] => Array ( [0] => ooarticle Object ( [_id] => 24 [_re_id] => 23 [_clang] => 0 [_name] => SIW allgemein [_catname] => SIW allgemein [_template_id] => 1 [_path] => |23| [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224592243 [_createdate] => 1224593861 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 24 [_catprior] => 1 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) [1] => ooarticle Object ( [_id] => 35 [_re_id] => 24 [_clang] => 0 [_name] => Presseinformation [_catname] => SIW allgemein [_template_id] => 1 [_path] => |23|24| [_prior] => 2 [_startpage] => 0 [_status] => 1 [_attributes] => [_updatedate] => 1224595796 [_createdate] => 1224592231 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 35 [_catprior] => 0 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) [1] => Array ( [0] => ooarticle Object ( [_id] => 25 [_re_id] => 23 [_clang] => 0 [_name] => Wirtschaftsstandort [_catname] => Wirtschaftsstandort [_template_id] => 1 [_path] => |23| [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224578042 [_createdate] => 1224593864 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 25 [_catprior] => 2 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) [2] => Array ( [0] => ooarticle Object ( [_id] => 26 [_re_id] => 23 [_clang] => 0 [_name] => Historische Innenstadt [_catname] => Historische Innenstadt [_template_id] => 1 [_path] => |23| [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224578074 [_createdate] => 1224593866 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 26 [_catprior] => 3 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) [3] => Array ( [0] => ooarticle Object ( [_id] => 27 [_re_id] => 23 [_clang] => 0 [_name] => Kulturförderkreis [_catname] => Kulturförderkreis [_template_id] => 1 [_path] => |23| [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224578111 [_createdate] => 1224593868 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 27 [_catprior] => 4 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) [4] => Array ( [0] => ooarticle Object ( [_id] => 36 [_re_id] => 23 [_clang] => 0 [_name] => Presse [_catname] => Presse [_template_id] => 1 [_path] => |23| [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224665149 [_createdate] => 1224665154 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 36 [_catprior] => 5 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) [5] => Array ( [0] => ooarticle Object ( [_id] => 23 [_re_id] => 0 [_clang] => 0 [_name] => SIW aktuell [_catname] => SIW aktuell [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => 1 [_attributes] => [_updatedate] => 1224602872 [_createdate] => 1224577960 [_updateuser] => acanzo [_createuser] => acanzo [_pid] => 23 [_catprior] => 2 [_label] => [_url] => [_revision] => [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) ) )


Ich erhalte aber folgende Fehlermeldung:

Fatal error: Call to a member function on a non-object in /www/htdocs/w008b8f6/standortinitiative-wurzen.de/redaxo/include/classes/class.rex_article.inc.php(250) : eval()'d code on line 10

Kann mir jemand helfen? Der Aufruf des Artikel-Objekts ist genau wie im Original-Modul
Hilfe!

Danke
Falko
acanzo
 
Beiträge: 132
Registriert: 26. Jul 2006, 18:53
Wohnort: Wurzen

Zurück zu Module/Aktionen [R4]

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast