Hi All
I need a specific categories_id to redirected to a "new" page. is there a elegant way to do that? (of course i can change the template of index.php and say if($GLOBALS['current_category_id']==123) thenn ....else if ($category_depth == 'nested') { ....
but the question is if there is a better solution....
thanks!
Elegant way / hook to redirect specific category_id to a "landingpage"
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Elegant way / hook to redirect specific category_id to a "landingpage"
Maybe the if in hooks/index and listen to inject_siteStart (I don't remember precisely how it's named)
//Daniel
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Elegant way / hook to redirect specific category_id to a "landingpage"
Code: Select all
class hook_shop_index_landing {
public function listen_siteWideStart() {
if ($GLOBALS['current_category_id'] == 123) {
// redirect
}
}
}-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Has thanked: 7 times
- Been thanked: 3 times
Re: Elegant way / hook to redirect specific category_id to a "landingpage"
hi ecartz
but does this work with a new content module?
i made a new contentmodule "landing_page" and want that the according content module is loaded instead of index_nested
does it work thenn with the hook?
but does this work with a new content module?
i made a new contentmodule "landing_page" and want that the according content module is loaded instead of index_nested
Code: Select all
if($GLOBALS['current_category_id'] == 1009){
echo $GLOBALS['current_category_id'];
?>
<div class="row">
<?php echo $oscTemplate->getContent('landing_page'); ?>
</div>
<?php
}-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Has thanked: 7 times
- Been thanked: 3 times
Re: Elegant way / hook to redirect specific category_id to a "landingpage"
i tried it but it seems it doesnt work like this, as i make not a redirection, i want to include the content 
any ideas how to make it like this?
Code: Select all
class hook_shop_index_landingpage {
public function listen_siteWideStart() {
if($GLOBALS['current_category_id'] == 1009){
?>
<div class="row">
<?php echo $oscTemplate->getContent('landing_page'); ?>
</div>
<?php
}
}
}