Hallo,
ich würde sehr gerne eine bestimmte Navigation in meine Seite einbauen, die ungefähr aussehen soll wie auf der folgenden Seite:
http://www.christophschmid.com/cms/webs ... erface.htm
Habe mir mal die ganzen Codes angeguckt - für mich alles nicht durchsehbar - kaum verständlich.
Ich würde mich sehr freuen, wenn mir jemand von euch "Cracks" weiterhelfen könnte.
Vielen Dank im Vorraus.
Liebe Grüße
Hallo,
Wir haben in letzter Zeit festgestellt, dass die Kommunikation via Slack viel schneller und zielführender ist als ein Beitrag im Forum. Aufgrund der neuen und besseren Möglichkeiten der Kommunikation haben wir uns entschlossen das Forum nur noch als Archiv zur Verfügung zu stellen. Somit bleibt es weiterhin möglich hier nach Lösungen zu suchen. Neue Beiträge können nicht mehr erstellt werden.
Wir empfehlen, für deine Fragen/Probleme Slack zu nutzen. Dort sind viele kompetente Benutzer aktiv und beantworten jegliche Fragen, gerne auch von REDAXO-Anfängern! Slack wird von uns sehr intensiv und meistens "rund um die Uhr" benutzt
Selbst einladen kannst Du dich hier: https://redaxo.org/slack/
Wir haben in letzter Zeit festgestellt, dass die Kommunikation via Slack viel schneller und zielführender ist als ein Beitrag im Forum. Aufgrund der neuen und besseren Möglichkeiten der Kommunikation haben wir uns entschlossen das Forum nur noch als Archiv zur Verfügung zu stellen. Somit bleibt es weiterhin möglich hier nach Lösungen zu suchen. Neue Beiträge können nicht mehr erstellt werden.
Wir empfehlen, für deine Fragen/Probleme Slack zu nutzen. Dort sind viele kompetente Benutzer aktiv und beantworten jegliche Fragen, gerne auch von REDAXO-Anfängern! Slack wird von uns sehr intensiv und meistens "rund um die Uhr" benutzt
Selbst einladen kannst Du dich hier: https://redaxo.org/slack/
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
Hi,
die Navi links oder oben?
PS: Tabellenlayouts sind nicht mehr Zeitgemäß!
so Layoutet man heute
Gruß,
Markus
die Navi links oder oben?
PS: Tabellenlayouts sind nicht mehr Zeitgemäß!
so Layoutet man heute
Gruß,
Markus
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
Hm sollte nicht so schwer sein...
Top-Level-Navi:
2nd-Level-Navi:
Side-Navi:
untested!
Gruß,
Markus
Top-Level-Navi:
Code: Alles auswählen
<?php
$path = explode("-",$this->getValue("path"));
array_shift( $path);
$cat_id = $path[0];
echo '<ul class="navi">';
foreach ( OOCategory::getRootCategories(true) as $oCategory) {
$name = $oCategory->getName();
$url = $oCategory->getUrl();
$cid = $oCategory->getId();
$class = '';
if ( $cat_id == $cid) {
$class = 'active';
}
echo '<li class="'. $class .'"><a href="'. $url .'">'. $name .'</a></li>';
}
echo '</ul>';
?>
Code: Alles auswählen
<?php
$path = explode("-",$this->getValue("path"));
array_shift( $path);
$cat_id = $path[0];
$subcat_id = $path[1];
$oCurrCat = OOCategory::getCategoryById($cat_id);
echo '<ul class="subnavi">';
foreach ( $oCurrCat->getChildren( true) as $oCategory) {
$name = $oCategory->getName();
$url = $oCategory->getUrl();
$cid = $oCategory->getId();
$class = '';
if ( $subcat_id == $cid) {
$class = 'active';
}
echo '<li class="'. $class .'"><a href="'. $url .'">'. $name .'</a></li>';
}
echo '</ul>';
?>
Code: Alles auswählen
<?php
$path = explode("-",$this->getValue("path"));
array_shift( $path);
$cat_id = $path[0];
$oCat = OOCategory::getCategoryById($cat_id);
$Articles = $oCat->getArticles( true);
if ( isset( $path[1])) {
$subcat_id = $path[1];
$oSubCat = OOCategory::getCategoryById($subcat_id);
$Articles = array_merge( $Articles, $oSubCat->getArticles( true));
}
echo '<ul class="sidenavi">';
foreach ( $Articles as $oArticle) {
$name = $oArticle->getName();
$url = $oArticle->getUrl();
$cid = $oArticle->getId();
$class = '';
if ( $subcat_id == $cid) {
$class = 'active';
}
echo '<li class="'. $class .'"><a href="'. $url .'">'. $name .'</a></li>';
}
echo '</ul>';
?>
untested!
Gruß,
Markus
Zuletzt geändert von Markus.Staab am 14. Jul 2005, 08:23, insgesamt 8-mal geändert.
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
habe ich dort stehen..
ich versuch ja schon durchzublicken, aber irgendwie steig ich halt nicht ganz durch
na wenn du oben auf der seite guckst, dann siehst du oben die haupt, links als erstes die seitennavi und dann unter den 3 oder 4 auswahlmöglichkeiten erst einen grauen block und darunter je nach auswahl noch mal verschiedene kategorien.
edit:
hab doch glatt jeweils das < vergessen. jetzt wird der code zwar hjeweils nicht mehr angezeigt, dafür habe ich gar keine auswahlmöglichkeiten in den navis gegeben. sie sind nicht vorhanden.
ich versuch ja schon durchzublicken, aber irgendwie steig ich halt nicht ganz durch
na wenn du oben auf der seite guckst, dann siehst du oben die haupt, links als erstes die seitennavi und dann unter den 3 oder 4 auswahlmöglichkeiten erst einen grauen block und darunter je nach auswahl noch mal verschiedene kategorien.
edit:
hab doch glatt jeweils das < vergessen. jetzt wird der code zwar hjeweils nicht mehr angezeigt, dafür habe ich gar keine auswahlmöglichkeiten in den navis gegeben. sie sind nicht vorhanden.
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
List of articles
I discovered Redaxo yesterday and am very impressed.
I am also trying to produce a layout with a main menu along the top and a list of the articles down the side. As you can see at www.hogarth.de all that I have managed is to copy the site map in to the side.
Ideally I would like a layout similar to http://popupboxx.de with the relevant articles down the side.
Kills wrote some code in this thread which I assumed would do what I wanted. The Haupt-Navi works but the Seiten-Navi brings an error on the line
foreach ( $oCurrCat->getChildren( true) as $oCategory) {
I am not a good enough programmer to debug the code.
Also I am not sure that this is going to show the articles and not the second level of categories. I would have expected to see something about
getArticlesOfCategory
in there but what do I know.
Thank you all in advance for your suggestions and time.
Have fun
I am also trying to produce a layout with a main menu along the top and a list of the articles down the side. As you can see at www.hogarth.de all that I have managed is to copy the site map in to the side.
Ideally I would like a layout similar to http://popupboxx.de with the relevant articles down the side.
Kills wrote some code in this thread which I assumed would do what I wanted. The Haupt-Navi works but the Seiten-Navi brings an error on the line
foreach ( $oCurrCat->getChildren( true) as $oCategory) {
I am not a good enough programmer to debug the code.
Also I am not sure that this is going to show the articles and not the second level of categories. I would have expected to see something about
getArticlesOfCategory
in there but what do I know.
Thank you all in advance for your suggestions and time.
Have fun
Life is not a practice
irgendwie wird kein menu dargestellt nachdem aufrufen der seite.
template sieht jetzt so aus:
sollte doch eigentlich alles soweit klappen oder nicht!? oder habe ich im code schon etwas falsch gemacht? css hab ich auch schon erstellt.. was mache ich falsch?
template sieht jetzt so aus:
Code: Alles auswählen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>REDAXO SimpleDemo - <? echo $this->getValue("name"); ?></title>
<link rel="stylesheet" type="text/css" href="files/main.css" media="screen" />
<script type="text/javascript" src="js/standard.js"></script>
<script type="text/javascript" src="js/flashdetect.js"></script>
</head>
<body>
<div><a name="top"></a></div>
<php include $REX[INCLUDE_PATH]."/generated/templates/5.template";
?>
<div id="website">
<!-- start #content -->
<div id="content">
<div id="content2">
<div id="main-block">
<div id="main-block2">
<?php
print '<h1>'.$this->getValue(name).'</h1>';
print htmlentities($this->getArticle());
?>
</div>
</div>
<div id="sub-block">
<div id="sub-block2">
<php include $REX[INCLUDE_PATH]."/generated/templates/6.template";
?>
</div>
</div>
<br class="clear" />
</div>
</div>
<!-- end #content -->
<div id="footer">
<p class="flLeft">Copyright 2005 by REDAXO Group</p>
<p class="flRight">CMS: Redaxo - Website: XHTML, CSS</p>
<br class="clear" />
</div>
</div> <!-- end #website -->
</body>
</html>
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
Re: List of articles
Hi,
I`ve tested the code on my local machine and it seems to work now.
If you want to use the navigation you have to create a structure which looks like that:
All nodes have to be categories...
Thats the most common way for redaxo structures.
Bye,
Markus
welcome to the community and redaxoNeill hat geschrieben:I discovered Redaxo yesterday and am very impressed.
If updated the sources in my post above.Neill hat geschrieben: Kills wrote some code in this thread which I assumed would do what I wanted. The Haupt-Navi works but the Seiten-Navi brings an error on the line
foreach ( $oCurrCat->getChildren( true) as $oCategory) {
I`ve tested the code on my local machine and it seems to work now.
If you want to use the navigation you have to create a structure which looks like that:
Code: Alles auswählen
- MainPoint1
- MainPoint2
+ SubPoint1
+ SubPoint2
- MainPoint3
+ SubPoint1
+ SubPoint2
- MainPoint4
- MainPoint5
+ SubPoint1
+ SubPoint2
+ SubPoint3
+ SubPoint4
Thats the most common way for redaxo structures.
Bye,
Markus
And once again thank you
Hello Markus!
Are you the duty expert. That is the second answer I have had from you.
The code now works perfectly. I can't see what you changed but it obviously did the trick.
Unfortunately the menu on the left now shows 2nd level nodes instead of articles. What I was aiming at was
1st level categories at the top on the first line. Second level categories at the top on the second line and the articles listed on the right side.
As you can see at www.hogarth.de the top line is ok. The second level categories appear but are in the middle of the first line. (I'm sure that I will get that sorted.) My problem is how to get the articles on the right as at http://popupboxx.de/
Thanks for all your help.
A great software with such knowledgable and helpful people in the forum has to be a hit.
Are you the duty expert. That is the second answer I have had from you.
The code now works perfectly. I can't see what you changed but it obviously did the trick.
Unfortunately the menu on the left now shows 2nd level nodes instead of articles. What I was aiming at was
1st level categories at the top on the first line. Second level categories at the top on the second line and the articles listed on the right side.
As you can see at www.hogarth.de the top line is ok. The second level categories appear but are in the middle of the first line. (I'm sure that I will get that sorted.) My problem is how to get the articles on the right as at http://popupboxx.de/
Thanks for all your help.
A great software with such knowledgable and helpful people in the forum has to be a hit.
Life is not a practice
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
Things are getting better
Once again - Thank you!
As you can see at www.hogarth.de I now have the first and second level installed and working.
In the side navigation code I found your deliberate mistake (the extra comma) and once I got that sorted everything worked without an error code.
The side navigation isn't showing the correct pages yet. You can see the structure on the site map page. The side nav bit is doing something strange and showing categories rather than articles but I may be able to find the mistake after a good nights sleep.
Thanks! You have helped me enormously.
Update: I found the problem. The following lines were wrong
$name = $oArticle->getName();
$url = $oArticle->getUrl();
$cid = $oArticle->getId();
Needed changing to $oArticle.
As I said - Thanks. See you on your snow board when you are next in the Alps!
Have fun
As you can see at www.hogarth.de I now have the first and second level installed and working.
In the side navigation code I found your deliberate mistake (the extra comma) and once I got that sorted everything worked without an error code.
The side navigation isn't showing the correct pages yet. You can see the structure on the site map page. The side nav bit is doing something strange and showing categories rather than articles but I may be able to find the mistake after a good nights sleep.
Thanks! You have helped me enormously.
Update: I found the problem. The following lines were wrong
$name = $oArticle->getName();
$url = $oArticle->getUrl();
$cid = $oArticle->getId();
Needed changing to $oArticle.
As I said - Thanks. See you on your snow board when you are next in the Alps!
Have fun
Life is not a practice
- Thomas.Blum
- Entwickler
- Beiträge: 5063
- Registriert: 24. Aug 2004, 22:11
- Wohnort: Dresden
- Kontaktdaten: Website
Hej,
Schön das einige das CSS-Template nutzen.
@Kills
Gruß Thomas
Kann nicht klappen. so sollte es aber.Havard hat geschrieben:sollte doch eigentlich alles soweit klappen oder nicht!? oder habe ich im code schon etwas falsch gemacht? css hab ich auch schon erstellt.. was mache ich falsch?Code: Alles auswählen
<php include $REX[INCLUDE_PATH]."/generated/templates/5.template"; ?> <php include $REX[INCLUDE_PATH]."/generated/templates/6.template"; ?>
Code: Alles auswählen
<?php include $REX[INCLUDE_PATH]."/generated/templates/5.template";
?>
<?php include $REX[INCLUDE_PATH]."/generated/templates/6.template";
?>
Schön das einige das CSS-Template nutzen.
@Kills
Warum schreibst du hier einen Code der eine Navi mit div's ausgibt? Mit einer Liste hat man mehr Möglichkeiten.kills hat geschrieben: so Layoutet man heute
Gruß Thomas
Habe jetzt schon Verschiedenes versucht, ich bekomme jedoch folgenden Fehler nicht weg (müsste doch jener sein, den Neill angesprochen hat oder?):
Das 6.template ist die subnavi. Und wo genau meint Neill, dass das Editieren von $oArticle?
Ich werd einfach aus diesen Codes nicht schlau =(
Hauptnavigation klappt jetzt super, (edit:= auch css =)
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /srv/www/htdocs/web6/html/cmstest/redaxo/redaxo/include/generated/templates/6.template on line 13
Ich werd einfach aus diesen Codes nicht schlau =(
Hauptnavigation klappt jetzt super, (edit:= auch css =)
Zuletzt geändert von Havard am 11. Jul 2005, 14:06, insgesamt 1-mal geändert.
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
All installed as just as I wanted
Ich bin so begeistert! deswegen wollte ich nochmal danke schreiben - diese mal in Deutsch inklusiv schlecht Rechtschreibung und Grammatik
Inzwischen stimmt das ganze Code von Kills. (ausser die , an ende von ein Zeile - diese erzeugt die fehler von Havard!) und ich habe es dankend übernommen auf www.hogarth.de
Jetzt nur eine paar Bilder einsetzen und css ändern und ....
Inzwischen stimmt das ganze Code von Kills. (ausser die , an ende von ein Zeile - diese erzeugt die fehler von Havard!) und ich habe es dankend übernommen auf www.hogarth.de
Jetzt nur eine paar Bilder einsetzen und css ändern und ....
Life is not a practice
nochmal =))
Will ja nicht nerven - aber bevor ich das Problem nie in den Griff kriege, will ich mein Problem von oben nochmal zitieren:
Havard hat geschrieben:Habe jetzt schon Verschiedenes versucht, ich bekomme jedoch folgenden Fehler nicht weg (müsste doch jener sein, den Neill angesprochen hat oder?):Das 6.template ist die subnavi. Und wo genau meint Neill, dass das Editieren von $oArticle?Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /srv/www/htdocs/web6/html/cmstest/redaxo/redaxo/include/generated/templates/6.template on line 13
Ich werd einfach aus diesen Codes nicht schlau =(
Hauptnavigation klappt jetzt super, (edit:) auch css =)
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
- Markus.Staab
- Entwickler
- Beiträge: 9634
- Registriert: 29. Jan 2005, 15:50
- Wohnort: Aschaffenburg/Germany
- Kontaktdaten: ICQ Website
Nein, ich meine nicht das es am trennen der templates liegt.Havard hat geschrieben:Du denkst es liegt am Einfügen der Codes durch seperate Templates??
Das klappt ja, aber er schmeißt mir halt den Fehler o.g. Fehler aus. Im neuen Code (Liste) scheint also auch noch ein Fehler zu sein.. oder er wird halt nur bei mir so ausgegeben =(
Könntest du bitte den Fehler weiter eingrenzen.
Welcher der 3 Templates wirft den Fehler?
Hast du den aktuellen Code aus dem 3. Post dieses Threads in deiner Navi? (Dieser wurde mittlerweile schon 3 mal upgedated.)
Gruß,
Markus
habe ich beim verfolgen dieses thema wohl mitbekommen und immer auf dem neuesten stand gehalten.
der fehler betrifft die 2nd level navi:
der fehler betrifft die 2nd level navi:
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /srv/www/htdocs/web6/html/cmstest/redaxo/redaxo/include/generated/templates/9.template on line 13