Hello Rebecca,
First, if you are going to make modifications to AtoM components, we recommend that you do so in a custom theme plugin. This will make it easier to maintain, and easier to upgrade in the future. Otherwise, you will need to reapply your changes every time you upgrade.
Custom theme resources
We have some guidance on making custom theme plugins in the following forum thread:
In your case, you would want to create a custom homeSuccess.php file in your theme, that does not include the code to call the Popular this week widget.
However you choose to proceed, there are 2 ways you could do this.
Method 1: comment out the relevant PHP line
The first, and preferred method, is to comment out the line that adds the widget to the home page, here:
In essence, replace:
- <?php echo get_component('default', 'popular', array('limit' => 10, 'sf_cache_key' => $sf_user->getCulture())) ?>
With:
- <?php // echo get_component('default', 'popular', array('limit' => 10, 'sf_cache_key' => $sf_user->getCulture())) ?>
If you create a custom theme, then you would do this in your custom homeSuccess.php file. If you want to do this directly in the base Dominion theme, then you would simply modify line 23 of the file found at apps/qubit/modules/staticpage/templates/homeSuccess.php.
For reference, the Popular this week widget code is found here - you shouldn't need to do anything with it if you follow the solution above, but if for some reason it doesn't work, you could also try commenting out this file. See:
After you make the changes, remember to:
- Recompile the CSS - for the base Dominion theme you can do this with: make -C plugins/arDominionPlugin
- If you create a custom theme, the command is the same, but change the name to that of your custom plugin: make -C plugins/yourCustomPluginName
- Clear the application cache: php symfony cc
- Restart PHP-FPM: i
- In Ubuntu 18.04 with PHP 7.2: sudo systemctl restart php7.2-fpm
- In Ubuntu 16.04 or 18.04 with PHP 7.0: sudo systemctl restart php7.0-fpm
- In Ubuntu 14.04 with PHP 5.x: sudo service php5-fpm restart
- Finally, remember to clear your web browser cache as well, so you are seeing the most recent version of the page.
Method 2: use CSS to hide the widget
Alternatively, you could also choose to use CSS to hide the widget - it has its own ID - fittingly named
#popular-this-week. This is not our recommended solution, but it could be done by adding a rule to one of the CSS files here:
like so:
#popular-this-week {
display: none;
}
It shouldn't matter which CSS file - the popular this week widget has a unique ID, so adding a custom rule shouldn't affect any other element - but I would probably add it to
scaffolding.less. However, note that using CSS in this manner could affect page ranking in Google, as Google apparently lowers rank results for any page that uses CSS to hide elements, as it thinks you are trying to cheat and hide keywords or links to boost the site's ranking. The better solution is simply to comment out the widget.
I would also recommend you follow the steps above to recompile the CSS, clear the application cache, restart PHP-FPM, and clear your web browser cache.
Regards,