dalex Posted May 16, 2017 Share Posted May 16, 2017 How do I disable news from showing in WHMCS front end? Link to comment Share on other sites More sharing options...
graisbeck Posted May 16, 2017 Share Posted May 16, 2017 How do I disable news from showing in WHMCS front end? I stopped the announcement from displaying by commenting out some of the code in homepage.tpl <!-- {if $twitterusername} <h2>{$LANG.twitterlatesttweets}</h2> <div id="twitterFeedOutput"> <p class="text-center"><img src="{$BASE_PATH_IMG}/loading.gif" /></p> </div> <script type="text/javascript" src="templates/{$template}/js/twitter.js"></script> {elseif $announcements} <h2>{$LANG.news}</h2> {foreach $announcements as $announcement} {if $announcement@index < 2} <div class="announcement-single"> <h3> <span class="label label-default"> {$announcement.rawDate|date_format:"M jS"} </span> <a href="{if $seofriendlyurls}{$WEB_ROOT}/announcements/{$announcement.id}/{$announcement.urlfriendlytitle}.html{else}announcements.php?id={$announcement.id}{/if}">{$announcement.title}</a> </h3> <blockquote> <p> {if $announcement.text|strip_tags|strlen < 350} {$announcement.text} {else} {$announcement.summary} <a href="{if $seofriendlyurls}{$WEB_ROOT}/announcements/{$announcement.id}/{$announcement.urlfriendlytitle}.html{else}announcements.php?id={$announcement.id}{/if}" class="label label-warning">{$LANG.readmore} »</a> {/if} </p> </blockquote> {if $announcementsFbRecommend} <script> (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="fb-like hidden-sm hidden-xs" data-layout="standard" data-href="{$systemurl}{if $seofriendlyurls}{$WEB_ROOT}/announcements/{$announcement.id}/{$announcement.urlfriendlytitle}.html{else}announcements.php?id={$announcement.id}{/if}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend"></div> <div class="fb-like hidden-lg hidden-md" data-layout="button_count" data-href="{$systemurl}{if $seofriendlyurls}{$WEB_ROOT}/announcements/{$announcement.id}/{$announcement.urlfriendlytitle}.html{else}announcements.php?id={$announcement.id}{/if}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend"></div> {/if} </div> {/if} {/foreach} {/if} --> Link to comment Share on other sites More sharing options...
brian! Posted May 16, 2017 Share Posted May 16, 2017 if you aren't using Annoucements on your site, the quickest way would just be to delete all announcements via the admin area... if you are and you just want them removed from the homepage, then you'd need to edit homepage.tpl or create a clientareapagehome action hook to alter the announcements and/or twitter arrays. Link to comment Share on other sites More sharing options...
dalex Posted May 17, 2017 Author Share Posted May 17, 2017 @graisbeck When you say comment, do you mean to remove that code which you provided above out of the homepage.tpl file? Link to comment Share on other sites More sharing options...
brian! Posted May 17, 2017 Share Posted May 17, 2017 @graisbeckWhen you say comment, do you mean to remove that code which you provided above out of the homepage.tpl file? yes he will have done... but you might as well leave the template alone and use a hook... <?php # Remove Announcements and/or Tweets from Homepage # Written by brian! function remove_announcements_from_homepage_hook($vars) { return array("announcements" => "", "twitterusername" => ""); } add_hook("ClientAreaPageHome", 1, "remove_announcements_from_homepage_hook"); ?> Link to comment Share on other sites More sharing options...
DeWebDude Posted May 17, 2017 Share Posted May 17, 2017 I recommend the hook method that Brian! recommended, keeps the rest of the code clean and your hooks are the only customization you have. Link to comment Share on other sites More sharing options...
dalex Posted May 18, 2017 Author Share Posted May 18, 2017 How do I use hooks? Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 How do I use hooks? you create a new .php file, giving it an appropriate filename (e.g newshomepage.php), in the /includes/hooks directory and paste the above code into it. refresh the homepage and the announcements and/or tweets should be gone. Link to comment Share on other sites More sharing options...
dalex Posted May 18, 2017 Author Share Posted May 18, 2017 Thanks for the help! Link to comment Share on other sites More sharing options...
Mohamad AlSayed Posted January 25, 2018 Share Posted January 25, 2018 I used this useful hook and all are now hidden. but now I have a lot of white space.. how can I reduce this space ? 3 Link to comment Share on other sites More sharing options...
Recommended Posts