Jump to content

Remove News on WHMCS Homepage


dalex

Recommended Posts

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

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

@graisbeck

When 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

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. :idea:

Link to comment
Share on other sites

  • 8 months later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated