Socialengine Tutorial – Disable default css from being loaded

I’ve been working on creating a custom homepage which uses twitter bootstrap however I’ve found the default css being generated by the socialengine is interferring with the bootstrap css.

In order to stop socialengine from adding in the default theme css files head to

Application > Modules > Core > Layouts > Scripts > default-simple.tpl

This default simple is what is loaded on every page and then injected with the page’s content. However I didn’t want any of that to load on my landing page so I’ve done the following;

(In this file look for line 75 where the ‘linking’ of css files begins and I’ve wrapped it in an if statement which says if the current url string == the default home page (e.g. /) then don’t bother loading the rest of the php)

<?php // LINK/STYLES ?>
  <?php
  $uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
  if(trim($uri, '/') !=  trim($this->baseUrl(), '/')):
  ?>
  <?php
    $this->headLink(array(
      'rel' => 'favicon',
      'href' => ( isset($this->layout()->favicon)
        ? $this->baseUrl() . $this->layout()->favicon
        : '/favicon.ico' ),
      'type' => 'image/x-icon'),
      'PREPEND');
    $themes = array();
    if( !empty($this->layout()->themes) ) {
      $themes = $this->layout()->themes;
    } else {
      $themes = array('default');
    }
    foreach( $themes as $theme ) {
      $this->headLink()
        ->prependStylesheet($this->baseUrl().'/application/css.php?request=application/themes/'.$theme.'/theme.css');
    }
    // Process
    foreach( $this->headLink()->getContainer() as $dat ) {
      if( !empty($dat->href) ) {
        if( false === strpos($dat->href, '?') ) {
          $dat->href .= '?c=' . $counter;
        } else {
          $dat->href .= '&c=' . $counter;
        }
      }
    }
  ?>
 
  <?php endif; ?>

Hope this helps 🙂

  • Javed

    Just comment or remove this code,

    $this->_helper->content
    ->setNoRender()
    ->setEnabled()
    ;

    and add this on your core index controller index action.
    $this->_helper->layout()->disableLayout();

    Then write your html and include css in core index controller , index.tpl template file.