X-Cart 5 Remove Categories from Homepage body
I was trying to remove the icons for the categories on the body of the homepage. Any assistance would be greatly appreciated.
|
Re: X-Cart 5 Remove Categories from Homepae body
Hi!
Thanks for asking! First thing to try is to apply the following CSS code via the System Settings > Look & feel > Custom CSS section in your admin area: Code:
ul.subcategory-list { Please, let me know if it works for you. Note: this approach will hide the subcategories from all the pages, not from home page only. |
Re: X-Cart 5 Remove Categories from Homepae body
I also want to know how to remove the categories from the bottom of the front page. Tony, your fix works but it also removed the sub-categories from the categories page. So when you click on a category you are taken to the page but it then does not show the sub-categories list. Any idea how to just remove them from the bottom of the main page? I have lots so it look bad on the main page.
Thank you. |
Re: X-Cart 5 Remove Categories from Homepae body
Hi Luis!
In this case, you need to create a simple mod. Create the module according to the article here: http://kb.x-cart.com/display/XDD/How+to+create+a+module and then add an additional class to your module: <Module-root>/View/Subcategories.php This class will decorate the \XLite\View\Subcategories class and it will re-define the getAllowedTargets() {} method. It should return array('category'), not array('category', 'main'). Please, let me know if it makes sense to you. If it is over-complicated, I will try to explain it in more details. |
Re: X-Cart 5 Remove Categories from Homepae body
Thank you for reply. I am confused. Should I create a file called main.php and add all the text from the "sample" except use the correct names for XLite\Module\Tony\Example; (XLite\Module\myMode\myname)? Then add "<Module-root>/View/Subcategories.php" to the bottom of the Mod?
Sorry, I guess I'll need a more detailed explanation. |
Re: X-Cart 5 Remove Categories from Homepae body
OK, let's start with one simple thing. Create the module according to the article above, but with your own Developer and Module IDs.
Once you are done, please let me know your Developer and Module IDs and I will suggest you about next step. |
Re: X-Cart 5 Remove Categories from Homepae body
Ok, I've created a Mod and enable it on my site (to test) and it works (no errors anyway). I'm not sure that it does anything. The identifiers are "Lou" and "Catsub"
This is the code I used and named "Main.php". Thanks you. <?php // vim: set ts=4 sw=4 sts=4 et: namespace XLite\Module\Lou\Catsub; /** * Module description * * @package XLite */ abstract class Main extends \XLite\Module\AModule { /** * Author name * * @return string */ public static function getAuthorName() { return 'Lou'; } /** * Module name * * @return string */ public static function getModuleName() { return 'Catsub'; } /** * Get module major version * * @return string */ public static function getMajorVersion() { return '5.0'; } /** * Module version * * @return string */ public static function getMinorVersion() { return 0; } /** * Module description * * @return string */ public static function getDescription() { return 'This Mod will show Categories on pages but not front'; } } |
Re: X-Cart 5 Remove Categories from Homepae body
That is good that you created the module. Indeed, it does not do anything at this point.
Next thing to do is to create the XLite/Module/Lou/Catsub/View/Subcategories.php file with the following content: PHP Code:
and it should do the trick. I will explain what this code does: you are taking default viewer XLite\View\Subcategories and decorate (change) it that it should be displayed only upon calling cart.php?target=category , so it would not work upon calling cart.php?target=main as it works by default. Please, try this code and let me know whether it works for you. Tony. |
Re: X-Cart 5 Remove Categories from Homepae body
Works perfectly! Thanks for your help.
|
Re: X-Cart 5 Remove Categories from Homepae body
Happy to hear that!
|
Re: X-Cart 5 Remove Categories from Homepae body
Quote:
I don't think "display:none" is a good practice to hide something unless it is being used to hide interactive element. This will make the element hidden for the user but it will still exist in the html code. Depending on content SE may consider the site is trying to serve different content to end users and bots (and Google for example will penalize if it thinks that's the case) or even think of it as spam... If some element should not be shown on a page best to comment out the code or have conditional statement but to simply use display:none is not something you should recommend. |
Re: X-Cart 5 Remove Categories from Homepae body
Quote:
How to hide the homepage categories only ? |
Re: X-Cart 5 Remove Categories from Homepae body
Tony for the sake of future searches please correct the title - "HomepaGe"
|
Re: X-Cart 5 Remove Categories from Homepae body
In 5.1 official release there will be special setting under "Catalog"->"Front page" section to define root category listing format: List | Icons | Hide
I hope you will review this feature in next 5.1 beta |
Re: X-Cart 5 Remove Categories from Homepage body
I have used Custom Skin and the PHP code to remove the categories from the homepage body - easy peasy (thanks Tony!). I would like to know how to remove the blank page space between my front page content and the footer menu...any suggestions?
|
Re: X-Cart 5 Remove Categories from Homepage body
Quote:
|
Re: X-Cart 5 Remove Categories from Homepage body
Here is an image of what I would like to remove - this is a screen shot of my homepage - I have quite a bit of blank space between my homepage content and the footer menu (I shaded it in the image) - I would like to remove it...
http://blueribbondesigns.com/xcart/var/theme/images/Screen%20shot%20shaded%20area.jpg Quote:
|
Re: X-Cart 5 Remove Categories from Homepage body
Quote:
I have made a quick tutorial on tweaking the CSS to accomplish this: http://youtu.be/3FwWfadCvuw Let me know if that helps. |
Re: X-Cart 5 Remove Categories from Homepage body
Quote:
You are a rock star!! This helped tremendously - I was making it more difficult than it needed to be - thanks for your help! |
Re: X-Cart 5 Remove Categories from Homepae body
Quote:
In this case, you need to apply a simple change using Custom skin module. This change is described here: https://docs.google.com/a/x-cart.com/document/d/1ZCwbHyqkklU1zNylERQnuD9U0JOlVPAwWarK9awU8yA/edit#heading=h.59ak5prm3pwh Search for "How to hide category block from home page and keep it on other pages?" title. |
All times are GMT -8. The time now is 06:21 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.