<jdoc:include type="component" /> displaying home - joomla

I am building my first joomla site I am stuck here- when I am including at my templates index.php.
<jdoc:include type="component" />
It is displaying Home at my front end. Can't find the solution need help.

Create a Custom Html module frontcomp and display it only on home page without writing any thing in it.
then add the following in index.php(template)
<?php if($this->countModules('frontcomp')) : ?>
<jdoc:include type="modules" name="frontcomp" style="xhtml" />
<?php endif; ?>
<?php if(!$this->countModules('frontcomp')) : ?>
<jdoc:include type="message" />
<jdoc:include type="component" />
<?php endif; ?>

Related

Add Structural Block - Magento 1.9

i have a problem with structural block in magento 1.9.
This is my local.xml layout file:
<layout version="0.1.0">
<default>
<reference name="root">
<block type="core/template" name="pluma" as="pluma" template="pluma/helloworld/simple_page.html"/>
</reference>
</default>
This is my 1column.phtml template file:
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices'); ?>
<pre><?php echo $this->getChildHtml('pluma'); ?></pre>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col1-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
</div>
</div>
<?php echo $this->getChildHtml('footer_before') ?>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('global_cookie_notice') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
And this is my template file (very simple):
<h1 style="background-color:yellow">Hello New Reference!</h1>
Magento response only "empty" tags. I don't understand my error..
Thanks in advance..
Try to use .phtml (default template files for magento) file instead of .html :
<layout version="0.1.0">
<default>
<reference name="root">
<block type="core/template" name="pluma" as="pluma" template="pluma/helloworld/simple_page.phtml"/>
</reference>
</default>
Also make sure you change the name in pluma/helloworld : simple_page.html -> simple_page.phtml

Joomla ver. 3 menu dropdown not working if not on active page

I have this Joomla 3.2 site which is still under development. For some reason, the dropdown effect on mouseover does not seem to work except when one is on the active page.
Am using a free template btw. Any ideas on troubleshooting this? No added menu extension has been used. All out of the box. Thinking this might be a js tweak, but been looking around and couldn't identify what and where...
An example of dropdown appearing is when you are on Project Sites and Contact Us sections.
A sample code of index.php that might help. Many thanks!
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$LeftMenuOn = ($this->countModules('position-4') or $this->countModules('position-5') or $this->countModules('position-7'));
$RightMenuOn = ($this->countModules('position-6') or $this->countModules('position-8'));
$TopNavOn = ($this->countModules('position-13'));
$app = JFactory::getApplication();
$sitename = $app->getCfg('sitename');
$sitetitle = $this->params->get('sitetitle');
$sitedescription = $this->params->get('sitedescription');
$logopath = $this->baseurl . '/templates/' . $this->template . '/images/logo.gif';
$logo = $this->params->get('logo', $logopath);
$logoimage = $this->params->get('logoimage');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template.css" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css' />
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/js/sfhover.js"></script>
</head>
<body>
<div id="wrapper">
<div id="header">
<!-- TopNav -->
<?php if($TopNavOn ): ?>
<div id="topnav">
<jdoc:include type="modules" name="position-13" style="xhtml" />
</div>
<?php endif; ?>
<!-- Logo -->
<div id="logo">
<?php if ($logo && $logoimage == 1): ?>
<img src="<?php echo htmlspecialchars($logo); ?>" alt="<?php echo $sitename; ?>" />
<?php endif; ?>
<?php if (!$logo || $logoimage == 0): ?>
<?php if ($sitetitle): ?>
<?php echo htmlspecialchars($sitetitle); ?><br/>
<?php endif; ?>
<?php if ($sitedescription): ?>
<div class="sitedescription"><?php echo htmlspecialchars($sitedescription); ?></div>
<?php endif; ?>
<?php endif; ?>
</div>
<!-- Search -->
<div id="search">
<jdoc:include type="modules" name="position-0" />
</div>
</div>
<div id="topmenu">
<jdoc:include type="modules" name="position-1" />
</div>
<br style="clear:both" />
<!-- Breadcrumbs -->
<?php if ($this->countModules('position-2')): ?>
<div id="breadcrumbs">
<jdoc:include type="modules" name="position-2" />
</div>
<?php endif; ?>
<!-- Left Menu -->
<?php if($LeftMenuOn ): ?>
<div id="leftmenu">
<jdoc:include type="modules" name="position-7" style="xhtml" />
<jdoc:include type="modules" name="position-4" style="xhtml" />
<jdoc:include type="modules" name="position-5" style="xhtml" />
</div>
<?php endif; ?>
<!-- Contents -->
<?php if($LeftMenuOn AND $RightMenuOn): ?>
<div id="content-w1">
<?php elseif($LeftMenuOn OR $RightMenuOn): ?>
<div id="content-w2">
<?php else: ?>
<div id="content-w3">
<?php endif; ?>
<?php if ($this->countModules('position-12')): ?>
<div id="content-top">
<jdoc:include type="modules" name="position-12" />
</div>
<?php endif; ?>
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<!-- Right Menu -->
<?php if($RightMenuOn ): ?>
<div id="rightmenu">
<jdoc:include type="modules" name="position-6" style="xhtml" />
<jdoc:include type="modules" name="position-8" style="xhtml" />
<jdoc:include type="modules" name="position-3" style="xhtml" />
</div>
<?php endif; ?>
<!-- Footer -->
<div id="footer">
<jdoc:include type="modules" name="position-14" />
</div>
<div id="push"></div>
</div>
Open the Menu Module in the Joomla Administrator, underneath the Options find Show Sub-menu Items and click Yes

Module Title Not Showed On Joomla Custom Template

I have been creating template for joomla 3.1, I was followed the instruction from joomla doc how to create it. Every thing is going fine. But, when I set module title is showed on front end, that module title is not showed. Below is snippet code of my template
<?php
defined('_JEXEC') or die( 'Restricted access' );
JLoader::import('joomla.filesystem.file');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jdoc:include type="head" />
</head>
<body>
<jdoc:include type="modules" name="top" />
<jdoc:include type="component" />
</body>
</html>
All module content is showed. Only the module title is not showed. Thanks for your advance
Your jdoc statement is missing the style attribute, which is what defines the type of module chrome is used, which is what renders the module's title. See http://docs.joomla.org/Module_chrome for more details.

Joomla - Migrating from 1.5 to 2.5 - <jdoc:include type="component" /> not rendering content in revised 2.5 template

We are migrating (migraining I should say) from 1.5 to 2.5 and our revised template from 1.5 is working, except it won't display any content when using . Please help!
Here is the code:
<body>
<div id="container">
<div id="header"> <img src="images/stories/blank.gif" width="180" height="93" border="0" alt="Home">
<div id="hdnav">
<jdoc:include type="modules" name="headnav" style="none" />
</div>
</div>
<div style="clear:both;"></div>
<div id="navigation">
<div id="topnav">
<jdoc:include type="modules" name="topnav" style="none" />
</div>
</div>
<div style="clear:both;"></div>
<div id="content">
<div id="maincontent">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<?php if($this->countModules('right')) : ?>
<div id="rightcol">
<jdoc:include type="modules" name="right" style="xhtml" />
</div>
<?php endif; ?>
</div>
<div id="footer">
<jdoc:include type="modules" name="footer" style="none" />
</div>
</div>
<jdoc:include type="modules" name="debug" />
</body>
</html>
styles
Please take the time to write new css for the divs. Tables are ancient and break easily and are a total nightmare on mobile devices.
overrides
If you do 1. you won't need them. Anyhow they're really easy.
A template override is simply a component or module view template which is copied under the your template's html subfolder (in a slightly different folder structure) and Joomla will use those instead of the original files.
So for example if you want to override article view, which is in
/components/com_content/views/article/tmpl/
its override would be placed in
/templates/your_template/html/com_content/article
One small catch: Make sure you always copy the whole tmpl folder of components, you must override all layouts inside the template.
You can find more info on
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

magento - remove recently added items

I want to remove "Recently added item" in cart sidebar on the front page of Magento. I can remove the following lines from checkout/cart/sidebar.phtml, but is there a less destructive way to do this, in case we want to quickly restore this in the future?
<?php // if(count($_items)): ?>
<!-- <p class="block-subtitle"><?php //echo $this->__('Recently added item(s)') ?></p> -->
<!-- <ol id="cart-sidebar" class="mini-products-list"> -->
<?php // foreach($_items as $_item): ?>
<?php // echo $this->getItemHtml($_item) ?>
<?php // endforeach; ?>
<!-- </ol> -->
<!-- <script type="text/javascript">decorateList('cart-sidebar', 'none-recursive')</script> -->
<?php // else: ?>
<!-- <p class="empty"><?php //echo $this->__('You have no items in your shopping cart.') ?></p> -->
<?php //endif ?>
You simply use following xml layout update in local.xml:
<remove name="cart_sidebar" />
OR
<action method="unsetChild"><name>cart_sidebar</name></action>
Cheers!
You could create a new template file with the new layout you require...
app/design/frontend/your_package/your_theme/template/checkout/cart/sidebar-updated.phtml
Then in your layout xml, you can change swap the sidebar template to the new version...
<default>
<reference name="cart_sidebar">
<action method="setTemplate"><template>checkout/cart/sidebar-updated.phtml</template></action>
</reference>
</default>
Then to revert back at any point, simply remove/comment out this layout xml
Better still, add this to your local.xml
<remove name="left.reports.product.viewed"/>
<remove name="right.reports.product.viewed"/>
To be more explicit it's in /app/design/frontent/default/[[your-theme-name]]/layout/local.xml.
Less intrusive for an easier upgrade path and this answer is an adaptation of the more intrusive solution I saw here.

Resources