S@nya Posted January 20, 2012 Share Posted January 20, 2012 Hi all! I have read the topics about showing/hiding modules on different pages, but i have not found solution to my problem. I will be grateful for some help. Please, tell me how can i show my module on several pages which works with one php file, but with different ID? For example: i have two blockcategories modules, one - shows categories from category.php?id_category=59 second - from category.php?id_category=58. I need to hide module which shows categories from 59 on page with id_category=58 Another words, i want to be able show some module on http://www.mysite.co...?id_category=59 and hide it on http://www.mysite.co...?id_category=58 Link to comment Share on other sites More sharing options...
Richard S Posted January 20, 2012 Share Posted January 20, 2012 If you are a programmer yourself, you could just implement this logic in your module PHP script and get id_category of a product or category page and to execute the PHP code or not. In addition, there is an ability to hook hooks in specific pages, to be more clear, you can exclude your hooks from specific pages. You can see this functionality by going to Modules -> Positions and try to add module to a new hook etc. You will see there a field except or similar. Link to comment Share on other sites More sharing options...
S@nya Posted January 20, 2012 Author Share Posted January 20, 2012 Hi! Thanks for fast reply. I`m not shure that my programming skills helps me change PHP code of the module file. I know about hooks. Actually i did like you adviced, i made two different hooks, transplanted modules there and exclude pages what i need. But i didn`t get the result what i need, because i can exclude category.php, but i cannot exclude page like "category.php?id_category=59" . Thats why i thought there is some much simple way to do it, something like this in module tpl: {if $category->id == 59} <div>{HOOK_NAME}</div> {elseif $category->id == 58} some other code Anyway, the trick with hooks must works fine and surely, and i try to use code like this in header.tpl (because my hooks in left column) to show/hide hooks with my modules. Thanks. Link to comment Share on other sites More sharing options...
S@nya Posted January 20, 2012 Author Share Posted January 20, 2012 Unfortunately my code doesn`t work, or maybe i write it in wrong place. Have someone any ideas? Link to comment Share on other sites More sharing options...
Richard S Posted January 21, 2012 Share Posted January 21, 2012 Hello, Yes, it is not working. However, it is hard to say what to change to you because there are no context on which you try to call it and do this. If you are doing this in any module hook that is hooked to front office, you could get category id by calling Tools::getValue('id_category), but it depends on which page are you in etc. Link to comment Share on other sites More sharing options...
S@nya Posted January 21, 2012 Author Share Posted January 21, 2012 Thanks for reply. I will try something else and post here if i`ll get some results. Anyway, thanks for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now