0
votes

Hi everyone I create a template in joomla and a menu..

this is my index.html template

<body class="cabecera <?php ($portada)? "" : "_otra"  ?> ">
        <div id="wrapper-top" class="fondo <?php ($portada)? "": "_otra" ?> ">
            <div class="row">
                <jdoc:include type="modules" name="mod_izquierdo" style="none"/>
                    <div id="wrapper-header-right" class="column grid_10">
                        <jdoc:include type="modules" name="mod_extranet" style="none"/>
                        <jdoc:include type="modules" name="mod_menuPrincipal" style="none"/>
                    </div>
            </div>
        </div>
        <div id="wrapper-body" class="row">
            <div id="content" class="column grid_16">
                <jdoc:include type="component" />
                <jdoc:include type="modules" name="mod_noticias" style="none"/>

            </div>
            <div class="clr"></div>
            <jdoc:include type="modules" name="mod_carrusel" style="none"/>
            <div class="clr"></div>

            <div id="noticias" class="column grid_16">

            </div>
        </div>
        <jdoc:include type="modules" name="mod_pie" style="none"/>
    </body>

for the menu I create a module mod_menuPrincipal this is the links

<div id="Menu_Principal">
    <ul class="menu">
        <li id="current" class="parent active item1"><a href="<?php echo JRoute::_('index.php?Itemid=1');?>"><span>Principal</span></a></li>
        <li class="item2"><a href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=2');?>"><span>Hardware</span></a></li>
        <li class="item3"><a href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=3');?>"<span>Software</span></a></li>
        <li class="item4"><a href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=4');?>""><span>Other</span></a></li>
    </ul>
</div>

I create the article, but now when I click the link don“t show me nothing.. only the footer and other thinks but no the content of the article.

I miss something? any idea?

2
I am just curious, why would you create your menu that way? You should really take advantage of the built in Joomla menus and menu module. Much easier to add/remove menu items later, plus you would get item IDs for the pages you want to have as menu items. Not to mention the SEF URL advantages of using menu items instead of hard coded links. - Brent Friar
Hi @BrentFriar I am very new in joomla, I am learning about that, in fact I do the menu with menu module too, so I have two menu one in a module create by me (code) and other create with Joomla menus and menu module, but I have not idea how to assosiate the menu with Joomla menus and menu module with my template. Do yo know any tutorial - user852610
The big thing to understand is that your template should be made up of module positions. Instead of <jdoc:include type="modules" name="mod_carrusel" style="none"/> you should have <jdoc:include type="modules" name="left" style="none"/>. Then in the module manager you can assign a module or more than 1 module to a particular position. For example, in the left column you could put a menu, a login box, and a newsletter sign up module. Lots of good info here - docs.joomla.org/Template_Development - Brent Friar

2 Answers

1
votes

You are missing -

<jdoc:include type="component" /> 

this loads the component. Add this into your index.php where you want to show the article. Let me know if this does not work.

0
votes

I would really think about mastering how menus work using a core template, the menu manager and the core mod_menu. That is really totally unrelated to your template. Make some menu links using the menu manager and see how they translate to the rendered page. Then work on creating a template if that is what you want to do.

Or do the reverse, first understand how templates work--use jdoc:include modules and module (and component and head) to put modules in different places on the page. Then learn to use the menu system.

THen put the two pieces together.

I think you will find it is much easier than you think.