Navigation funktioniert nicht

Wie verwendet man Templates oder erstellt Navigationen und passt diese an.

Navigation funktioniert nicht

Beitragvon redaxoist » 15. Jul 2011, 10:21

Hallo,

habe eine ganze Weile nichts mehr mit Redaxo gemacht und jetzt ein Update von 3.2 auf 4.3 vorgenommen. Ich habe meine alte Datenbank erhalten und durch SQL Statements nach und nach aktualisiert. Im Backend wird mir nun alles korrekt angezeigt und funktioniert auch. Aber ich verzweifel daran ein Navigationsmenü auszugeben.

Ich verwende folgenden Code:
Code: Alles auswählen
# Bestimmt den Kategoriepfad
$t10v_navigation = '';

$catcur = explode("|",$this->getValue("path").$this->getValue("article_id")."|");

foreach (OOCategory::getRootCategories() as $lev1) {
print_r($lev1);
   if ($lev1->isOnline())
    {
      if ($lev1->getId() == $catcur[1]) {
      // Aktuelle Seite
         $t10v_navigation .= '<p class="navi"><a href="'.rex_getUrl($lev1->getId()).'">'.$lev1->getName().'</a></p>'."\n";
      } else {
         $t10v_navigation .= '<p class="navi"><a href="'.rex_getUrl($lev1->getId()).'">'.$lev1->getName().'</a></p>'."\n";
      }
   }
}

und erhalte
Code: Alles auswählen
OOCategory Object ( [_id] => 1 [_re_id] => 0 [_clang] => 0 [_name] => Index [_catname] => Index [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1310720157 [_createdate] => 1310720140 [_updateuser] => pflaphys-ad [_createuser] => pflaphys-ad [_pid] => 1 [_catprior] => 1 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 2 [_re_id] => 0 [_clang] => 0 [_name] => Aktuelles [_catname] => Aktuelles [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1248946121 [_createdate] => 1310715788 [_updateuser] => kunath [_createuser] => pflaphys-ad [_pid] => 2 [_catprior] => 2 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 3 [_re_id] => 0 [_clang] => 0 [_name] => Forschung [_catname] => Forschung [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1144939443 [_createdate] => 1310715791 [_updateuser] => kunath [_createuser] => pflaphys-ad [_pid] => 3 [_catprior] => 3 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 4 [_re_id] => 0 [_clang] => 0 [_name] => Lehrveranstaltungen [_catname] => Lehre [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1250084919 [_createdate] => 1310715793 [_updateuser] => kunath [_createuser] => pflaphys-ad [_pid] => 4 [_catprior] => 4 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 87 [_re_id] => 0 [_clang] => 0 [_name] => Studieren im Ausland [_catname] => Studieren im Ausland [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1168536521 [_createdate] => 1310715796 [_updateuser] => kunath [_createuser] => pflaphys-ad [_pid] => 154 [_catprior] => 5 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 5 [_re_id] => 0 [_clang] => 0 [_name] => Mitarbeiter [_catname] => Mitarbeiter [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1305789591 [_createdate] => 1144764565 [_updateuser] => kunath [_createuser] => kunath [_pid] => 5 [_catprior] => 6 [_STATUS] => 1 [_revision] => 0 ) OOCategory Object ( [_id] => 6 [_re_id] => 0 [_clang] => 0 [_name] => Publikationen [_catname] => Publikationen [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1191407215 [_createdate] => 1310715820 [_updateuser] => kunath [_createuser] => pflaphys-ad [_pid] => 6 [_catprior] => 7 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => ) OOCategory Object ( [_id] => 142 [_re_id] => 0 [_clang] => 0 [_name] => Journal of Plant Physiology [_catname] => J. of Plant Physiology [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1214909811 [_createdate] => 1214861812 [_updateuser] => kunath [_createuser] => kunath [_pid] => 274 [_catprior] => 8 [_STATUS] => 1 [_revision] => 0 ) OOCategory Object ( [_id] => 102 [_re_id] => 0 [_clang] => 0 [_name] => Kontakt, Lage, Reise [_catname] => An/Abreise [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1191483923 [_createdate] => 1191243236 [_updateuser] => kunath [_createuser] => kunath [_pid] => 192 [_catprior] => 9 [_STATUS] => 1 [_revision] => 0 ) OOCategory Object ( [_id] => 7 [_re_id] => 0 [_clang] => 0 [_name] => Links [_catname] => Links [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1296808057 [_createdate] => 1144764615 [_updateuser] => kunath [_createuser] => kunath [_pid] => 7 [_catprior] => 10 [_STATUS] => 1 [_revision] => 0 ) OOCategory Object ( [_id] => 85 [_re_id] => 0 [_clang] => 0 [_name] => Software [_catname] => Programme [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1199460457 [_createdate] => 1156672805 [_updateuser] => kunath [_createuser] => kunath [_pid] => 150 [_catprior] => 11 [_STATUS] => 1 [_revision] => 0 ) OOCategory Object ( [_id] => 112 [_re_id] => 0 [_clang] => 0 [_name] => Archiv [_catname] => Archiv [_template_id] => 11 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1212056986 [_createdate] => 1212056879 [_updateuser] => kunath [_createuser] => kunath [_pid] => 214 [_catprior] => 12 [_STATUS] => 0 [_revision] => 0 ) OOCategory Object ( [_id] => 96 [_re_id] => 0 [_clang] => 0 [_name] => Einladung [_catname] => Phykologensektionstagung 2008 [_template_id] => 9 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1208333979 [_createdate] => 1191230531 [_updateuser] => kunath [_createuser] => kunath [_pid] => 178 [_catprior] => 13 [_STATUS] => 0 [_revision] => 0 ) OOCategory Object ( [_id] => 46 [_re_id] => 0 [_clang] => 0 [_name] => Intern [_catname] => Intern [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1144940859 [_createdate] => 1144851367 [_updateuser] => kunath [_createuser] => kunath [_pid] => 47 [_catprior] => 14 [_STATUS] => 0 [_revision] => 0 ) OOCategory Object ( [_id] => 88 [_re_id] => 0 [_clang] => 0 [_name] => Spezialseiten [_catname] => Spezialseiten [_template_id] => 0 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1191411692 [_createdate] => 1168548341 [_updateuser] => kunath [_createuser] => kunath [_pid] => 156 [_catprior] => 15 [_STATUS] => 0 [_revision] => 0 ) OOCategory Object ( [_id] => 148 [_re_id] => 0 [_clang] => 0 [_name] => test [_catname] => test [_template_id] => 1 [_path] => | [_prior] => 1 [_startpage] => 1 [_status] => [_attributes] => [_updatedate] => 1310718663 [_createdate] => 1310718634 [_updateuser] => pflaphys-ad [_createuser] => pflaphys-ad [_pid] => 286 [_catprior] => 16 [_STATUS] => 1 [_revision] => 0 [_art_online_from] => [_art_online_to] => [_art_description] => [_art_keywords] => [_art_file] => [_art_teaser] => [_art_type_id] => )

Also scheinen die Daten erstmal korrekt in das Array $lev1 übernommen zu werden. Doch mit der Frage ob die Daten online sind $lev1->isOnline() hört es dann auf. Es wird einfach nichts in $t10v_navigation gespeichert. Ich habe auch einmal neue Kategorien angelegt mit der Vermutung das vielleicht irgendetwas am Status nach dem Update nicht stimmt. Aber On/Offlinestellungen sind ohne Probleme und Fehlermeldungen möglich, eine Navigation erhalte ich dennoch nicht.
redaxoist
 
Beiträge: 128
Registriert: 7. Feb 2006, 11:15

Re: Navigation funktioniert nicht

Beitragvon redaxoist » 15. Jul 2011, 10:34

achso das DB Feld "Status" in "rex_article" ist als tinyint(1) definiert und alle Artikel haben entweder eine 1 oder 0 darin stehen.

Dennoch, der Hauptfehler scheint in der Onlineerkennung zu liegen.

Das hier

Code: Alles auswählen
foreach (OOCategory::getRootCategories(true) as $lev1) {


gibt auch nur Mist bzw. ebend nichts aus.
redaxoist
 
Beiträge: 128
Registriert: 7. Feb 2006, 11:15

Re: Navigation funktioniert nicht

Beitragvon Richard.Laing » 15. Jul 2011, 10:45

hi redaxoist
seit 3.2 hat sich natürlich einiges getan,

evtl. solltest du auf die rex_navigation::factory() umsteigen.
mit dieser solltest du so gut wie alles an navigationen hinbekommen.
und ist einfacher und ohne programierkram.

Code: Alles auswählen
<?php // PHP oberhalb von Html;?>
<?php $P = explode("|",$this->getValue("path").$this->getValue("article_id")."|"); $rexnav = rex_navigation::factory();?>

<?php // erste ebene ;?>
<?php echo $rexnav->get(0,1,FALSE,TRUE); ?>

<?php // zweite ebene ;?>
<?php echo $rexnav->get($P[1],1,FALSE,TRUE); ?>

<?php // dritte ebene ;?>
<?php if (isset($P[2]) && $P[2] > 0) echo $rexnav->get($P[2],1,FALSE,TRUE); ?><?php require_once('Connections/test.php'); ?>

oder auch mal hier reinschauen.
http://www.rexvideo.de/tutorials/tags/navigation/navigation.html
hier auch nochmal genauer beschrieben.
http://www.redaxo.org/de/forum/post91951.html#p91951
gruss richy
REXvideo Videotutorials für Redaxo www.REXvideo.de
Webseite www.on-laing.de smokezig.de www.smokezig.de
Benutzeravatar
Richard.Laing
 
Beiträge: 2109
Registriert: 27. Aug 2005, 23:55
Wohnort: Brühl / Rheinland

Re: Navigation funktioniert nicht

Beitragvon redaxoist » 15. Jul 2011, 12:29

vielen Dank

Code: Alles auswählen
<?php
$rexnav = rex_navigation::factory();
echo $rexnav->get(0,1,FALSE,TRUE);
?>


ergibt

Code: Alles auswählen
Fatal error: Call to a member function get() on a non-object in /data/homewww/pflaphys/webdir/redaxo/include/classes/class.rex_article_base.inc.php(388) : eval()'d code on line 214


erstelle ich ein Template nur mit diesen Teilen und binde es an eine testseite, dann bleibt diese leer (d.h. ohne navigation, aber auch ohne fehlermeldung).
redaxoist
 
Beiträge: 128
Registriert: 7. Feb 2006, 11:15

Re: Navigation funktioniert nicht

Beitragvon Richard.Laing » 15. Jul 2011, 12:49

hmmm das müsste ich mir im system anschauen, wenn du magst das ich das kurz mache, leg mir bitte einen temp. admin zugang an und schick mir den inkl. link zur seite per pn.
gruß richy
REXvideo Videotutorials für Redaxo www.REXvideo.de
Webseite www.on-laing.de smokezig.de www.smokezig.de
Benutzeravatar
Richard.Laing
 
Beiträge: 2109
Registriert: 27. Aug 2005, 23:55
Wohnort: Brühl / Rheinland

Re: Navigation funktioniert nicht

Beitragvon redaxoist » 15. Jul 2011, 13:09

ok, jetzt funktioniert es. die fehlermeldung entstand durch die verwendung zweier unterschiedlicher variablen. warum er jetzt auf einmal die navigation anzeigt (auch mit meinem alten code) ist mir schleierhaft. cache hatte ich bereits mehrmals gelöscht.

vielen dank.
redaxoist
 
Beiträge: 128
Registriert: 7. Feb 2006, 11:15

Re: Navigation funktioniert nicht

Beitragvon Richard.Laing » 15. Jul 2011, 13:25

hmm kann ich dir so such net sagen ;)
aber wenn es geht ist doch alles bestens.
gruß richy

PS: please make it [SOLVED]
REXvideo Videotutorials für Redaxo www.REXvideo.de
Webseite www.on-laing.de smokezig.de www.smokezig.de
Benutzeravatar
Richard.Laing
 
Beiträge: 2109
Registriert: 27. Aug 2005, 23:55
Wohnort: Brühl / Rheinland


Zurück zu Templates/Navigationen [R4]

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast