NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:phpwcms-system:artikel:contentparts:news [2010/05/31 12:38] Knut Heermann (flip-flop) |
deutsch:phpwcms-system:artikel:contentparts:news [2018/06/03 18:08] (current) |
||
|---|---|---|---|
| Line 238: | Line 238: | ||
| ===== Workaround NEWS auf Index-Seite: ===== | ===== Workaround NEWS auf Index-Seite: ===== | ||
| - | Werden NEWs auf der Indexseite des Systems verwendet, und der Alias ist noch nicht sichtbar in der Browsereingabezeile, wird der Link auf die NEWs-Details nicht richtig geschrieben. | + | **Nur für NEWs die auf der Indexseite des Systems verwendet werden:** |
| - | Dieser CP-Trigger im Ordner /frontend_render/ beseitigt das Problem. //(Das sollte im Core berücksichtigt werden).// | + | Ist der Alias noch nicht sichtbar in der Browsereingabezeile //(z.B. http://example.com/ anstatt http://example.com/index.phtml)//, wird der Link auf die NEWs-Details nicht richtig geschrieben. |
| + | |||
| + | Dieser CP-Trigger im Ordner /frontend_render/ beseitigt das Problem. //(Das sollte eigentlich im Core berücksichtigt werden).// | ||
| ---- | ---- | ||
| Line 267: | Line 269: | ||
| * | * | ||
| * E.g. In Browserline you see: http://example.com/ | * E.g. In Browserline you see: http://example.com/ | ||
| - | * This can´t ran: http://example.com/index.php&newsdetail=20100501-1_news01 | + | * This can´t run: http://example.com/index.php&newsdetail=20100501-1_news01 |
| * We need: http://example.com/index.php?index&newsdetail=20100501-1_news01 | * We need: http://example.com/index.php?index&newsdetail=20100501-1_news01 | ||
| ********************************************************************************************* | ********************************************************************************************* | ||
| Line 279: | Line 281: | ||
| function NEWS_DETAIL_LINK_ROOT($text, & $data) { | function NEWS_DETAIL_LINK_ROOT($text, & $data) { | ||
| + | |||
| // The right CP news (33) and we are located in the root directory | // The right CP news (33) and we are located in the root directory | ||
| - | if ( $data['acontent_type'] == 33 AND ( strpos($text, 'index.php&newsdetail') ) ) | + | if ( $data['acontent_type'] == 33 AND ( $GLOBALS['content']['cat_id'] == 0 ) ) |
| { | { | ||
| - | $text = str_replace('index.php&newsdetail','index.php?'.$GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"].'&newsdetail',$text); | + | if ( strpos($text, 'index.php&newsdetail') !== false) |
| + | $text = str_replace('index.php&newsdetail','index.php?'.$GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"].'&newsdetail',$text); | ||
| } | } | ||
| return $text; | return $text; | ||
| - | } | + | } |
| - | register_cp_trigger('NEWS_DETAIL_LINK_ROOT'); | + | |
| + | register_cp_trigger('NEWS_DETAIL_LINK_ROOT'); | ||
| ?> | ?> | ||