New module position

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Aug 24, 2016 10:09 am
Reply with quote
Report this post
Hello guys. =)

I've used your documentation about adding a new module position - https://www.gavick.com/documentation/joomla/templates/customization/how-to-add-new-module-position - the first 2 steps works fine but I'm not sure if I put the php code correctly into the default.php. :?

I want a module position between the main menu and the sidebar + content. I can see the module now, but the content is missing.

module.JPG


I've used the gk Highlighter module but it isnt shown. Did I paste it wrong?

Code: Select all
<?php

/**
 *
 * Default view
 *
 * @version             1.0.0
 * @package             Gavern Framework
 * @copyright         Copyright (C) 2010 - 2011 GavickPro. All rights reserved.
 *               
 */
 
// No direct access.
defined('_JEXEC') or die;
//
$app = JFactory::getApplication();
$user = JFactory::getUser();
// getting User ID
$userID = $user->get('id');
// getting params
$option = JRequest::getCmd('option', '');
$view = JRequest::getCmd('view', '');
// defines if com_users
define('GK_COM_USERS', $option == 'com_users' && ($view == 'login' || $view == 'registration'));
// other variables
$btn_login_text = ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT');
// make sure that the modal will be loaded
JHTML::_('behavior.modal');
//
$page_suffix_output = $this->API->get('template_pattern', 'none') != 'none' ? 'pattern' . $this->API->get('template_pattern', 'none') . ' ' : '';
$page_suffix_output .= $this->page_suffix;
$tpl_page_suffix = $page_suffix_output != '' ? ' class="'.$page_suffix_output.'" ' : '';

?>
<!DOCTYPE html>
<html lang="<?php echo $this->APITPL->language; ?>" <?php echo $tpl_page_suffix; ?>>
<head>
   <?php $this->layout->addTouchIcon(); ?>
   <?php if(
         $this->browser->get('browser') == 'ie6' ||
         $this->browser->get('browser') == 'ie7' ||
         $this->browser->get('browser') == 'ie8' ||
         $this->browser->get('browser') == 'ie9'
      ) : ?>
   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
   <?php endif; ?>
    <?php if($this->API->get('rwd', 1)) : ?>
       <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
   <?php else : ?>
      <meta name="viewport" content="width=<?php echo $this->API->get('template_width', 1020)+80; ?>">
   <?php endif; ?>
    <jdoc:include type="head" />
    <?php $this->layout->loadBlock('head'); ?>
   <?php $this->layout->loadBlock('cookielaw'); ?>
</head>
<body<?php echo $tpl_page_suffix; ?><?php if($this->browser->get("tablet") == true) echo ' data-tablet="true"'; ?><?php if($this->browser->get("mobile") == true) echo ' data-mobile="true"'; ?><?php $this->layout->generateLayoutWidths(); ?> data-smoothscroll="<?php echo $this->API->get('use_smoothscroll', '1'); ?>">   
   <?php
        // put Google Analytics code
        echo $this->social->googleAnalyticsParser();
   ?>
   <?php if ($this->browser->get('browser') == 'ie7' || $this->browser->get('browser') == 'ie6') : ?>
   <!--[if lte IE 7]>
   <div id="ieToolbar"><div><?php echo JText::_('TPL_GK_LANG_IE_TOOLBAR'); ?></div></div>
   <![endif]-->
   <?php endif; ?>

   <?php if($this->API->modules('topbar')) : ?>
   <div id="gkTopBar">
      <div class="gkPage">
         <jdoc:include type="modules" name="topbar" style="<?php echo $this->module_styles['topbar']; ?>" />
      </div>
   </div>
   <?php endif; ?>
   
   <?php if(count($app->getMessageQueue())) : ?>
   <jdoc:include type="message" />
   <?php endif; ?>
   
    <header id="gkHeader">
       <div>
          <div class="gkPage" id="gkHeaderNav">                       
             <?php $this->layout->loadBlock('logo'); ?>
            
            <?php if($this->API->get('show_menu', 1) && $this->API->get('menu_type', 'classic') == 'classic') : ?>
            <div id="gkMobileMenu" class="gkPage"> <i id="mobile-menu-toggler" class="fa fa-bars"></i>
                <select id="mobileMenu" onChange="window.location.href=this.value;" class="chzn-done">
                    <?php
                      $this->mobilemenu->loadMenu($this->API->get('menu_name','mainmenu'));
                      $this->mobilemenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                  ?>
                </select>
            </div>
            <?php endif; ?>
            
            <div id="gkTopNav">
               <?php if(
                  $this->API->get('login_url', '') != '' ||
                  ($this->API->get('reg_url', '') != '' && $userID == 0)
               ) : ?>
               <div id="gkUserArea">
                     <?php echo JText::_('TPL_GK_LANG_USERAREA'); ?>
                     <?php if($userID == 0) : ?>
                        <?php echo JText::_('TPL_GK_LANG_USERAREA_VISITOR'); ?>
                     <?php else : ?>
                        <strong><?php echo $user->get('username'); ?></strong>
                     <?php endif; ?>

                  <?php echo JText::_('TPL_GK_LANG_LOGIN_PRE'); ?>

                   <?php if($this->API->get('login_url', 'index.php?option=com_users&view=login')) : ?>
                      <a href="<?php echo $this->API->get('login_url', 'index.php?option=com_users&view=login'); ?>" id="gkLogin"><?php echo ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT'); ?></a>
                   <?php endif; ?>
                  
                   <?php if($this->API->get('reg_url', 'index.php?option=com_users&view=registration') != '' && $userID == 0) : ?>
                      <?php echo JText::_('TPL_GK_LANG_REGISTER_PRE'); ?>
                      <a href="<?php echo $this->API->get('reg_url', 'index.php?option=com_users&view=registration'); ?>"><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></a>
                   <?php endif; ?>
                </div>
                <?php endif; ?>
               
                <?php if($this->API->modules('topnav')) : ?>
                <div id="gkTopMenu">
                   <jdoc:include type="modules" name="topnav" style="<?php echo $this->module_styles['topnav']; ?>"  modnum="<?php echo $this->API->modules('topnav'); ?>" modcol="3" />
                </div>
                <?php endif; ?>
                 </div>
                 
                 <?php if($this->API->get('show_menu', 1)) : ?>
                 <div id="gkMainMenu" <?php echo $this->API->get('menu_type', 'classic') == 'overlay' ? 'class="gkPage gkMenuOverlay"' : 'class="gkPage gkMenuClassic"'; ?>>
                         <?php
                       $this->mainmenu->loadMenu($this->API->get('menu_name','mainmenu'));
                        $this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                    ?>
                 </div>
                 <?php endif; ?>
          </div>
       </div>
    </header>

   <div id="gkPageContent">
       <div class="gkPage">
          <section id="gkContent">
            <?php if($this->API->modules('highlight')) : ?>
<div id="style">
<div class="newstyle"> <jdoc:include type="modules" name="highlight"
style="<?php echo $this->module_styles['highlight']; ?>" />
</div>
<?php endif; ?>
</div>               
            <div id="gkContentWrap"<?php if($this->API->get('sidebar_position', 'right') == 'left') : ?> class="gkSidebarLeft"<?php endif; ?>>
               <?php if($this->API->modules('top1')) : ?>
               <section id="gkTop1" class="gkCols3<?php if($this->API->modules('top1') > 1) : ?> gkNoMargin<?php endif; ?>">
                  <div>
                     <jdoc:include type="modules" name="top1" style="<?php echo $this->module_styles['top1']; ?>"  modnum="<?php echo $this->API->modules('top1'); ?>" modcol="3" />
                  </div>
               </section>
               <?php endif; ?>
               
               <?php if($this->API->modules('top2')) : ?>
               <section id="gkTop2" class="gkCols3<?php if($this->API->modules('top2') > 1) : ?> gkNoMargin<?php endif; ?>">
                  <div>
                     <jdoc:include type="modules" name="top2" style="<?php echo $this->module_styles['top2']; ?>" modnum="<?php echo $this->API->modules('top2'); ?>" modcol="3" />
                  </div>
               </section>
               <?php endif; ?>
               
               <?php if($this->API->modules('breadcrumb') || $this->getToolsOverride()) : ?>
               <section id="gkBreadcrumb">
                  <?php if($this->API->modules('breadcrumb')) : ?>
                  <jdoc:include type="modules" name="breadcrumb" style="<?php echo $this->module_styles['breadcrumb']; ?>" />
                  <?php endif; ?>
                  
                  <?php if($this->getToolsOverride()) : ?>
                     <?php $this->layout->loadBlock('tools/tools'); ?>
                  <?php endif; ?>
               </section>
               <?php endif; ?>
               
               <?php if($this->API->modules('mainbody_top')) : ?>
               <section id="gkMainbodyTop">
                  <jdoc:include type="modules" name="mainbody_top" style="<?php echo $this->module_styles['mainbody_top']; ?>" />
               </section>
               <?php endif; ?>   
               
               <section id="gkMainbody">
                  <?php if(($this->layout->isFrontpage() && !$this->API->modules('mainbody')) || !$this->layout->isFrontpage()) : ?>
                     <jdoc:include type="component" />
                  <?php else : ?>
                     <jdoc:include type="modules" name="mainbody" style="<?php echo $this->module_styles['mainbody']; ?>" />
                  <?php endif; ?>
               </section>
               
               <?php if($this->API->modules('mainbody_bottom')) : ?>
               <section id="gkMainbodyBottom">
                  <jdoc:include type="modules" name="mainbody_bottom" style="<?php echo $this->module_styles['mainbody_bottom']; ?>" />
               </section>
               <?php endif; ?>
            </div>
            
            <?php if($this->API->modules('sidebar')) : ?>
            <aside id="gkSidebar"<?php if($this->API->modules('sidebar') == 1) : ?> class="gkOnlyOne"<?php endif; ?>>
               <div>
                  <jdoc:include type="modules" name="sidebar" style="<?php echo $this->module_styles['sidebar']; ?>" />
               </div>
            </aside>
            <?php endif; ?>
          </section>
      </div>
   </div>
   
   <?php if($this->API->modules('bottom1')) : ?>
   <section id="gkBottom1" class="gkPage">
      <div class="gkCols6<?php if($this->API->modules('bottom1') > 1) : ?> gkNoMargin<?php endif; ?>">
         <jdoc:include type="modules" name="bottom1" style="<?php echo $this->module_styles['bottom1']; ?>" modnum="<?php echo $this->API->modules('bottom1'); ?>" />
      </div>
   </section>
   <?php endif; ?>
   
    <?php if($this->API->modules('bottom2')) : ?>
    <section id="gkBottom2" class="gkPage">
       <div class="gkCols6<?php if($this->API->modules('bottom2') > 1) : ?> gkNoMargin<?php endif; ?>">
          <jdoc:include type="modules" name="bottom2" style="<?php echo $this->module_styles['bottom2']; ?>" modnum="<?php echo $this->API->modules('bottom2'); ?>" />
       </div>
    </section>
    <?php endif; ?>
   
    <?php if($this->API->modules('bottom3')) : ?>
    <section id="gkBottom3">
       <div class="gkCols6<?php if($this->API->modules('bottom3') > 1) : ?> gkNoMargin<?php endif; ?> gkPage">
          <jdoc:include type="modules" name="bottom3" style="<?php echo $this->module_styles['bottom3']; ?>" modnum="<?php echo $this->API->modules('bottom3'); ?>" />
       </div>
    </section>
    <?php endif; ?>
   
    <?php if($this->API->modules('lang')) : ?>
    <section id="gkLang">
       <div class="gkPage">
            <jdoc:include type="modules" name="lang" style="<?php echo $this->module_styles['lang']; ?>" />
         </div>
    </section>
    <?php endif; ?>
   
    <?php $this->layout->loadBlock('footer'); ?>
      <?php $this->layout->loadBlock('social'); ?>
      <?php $this->layout->loadBlock('tools/cart'); ?>
      <?php $this->layout->loadBlock('tools/login'); ?>
         
   <jdoc:include type="modules" name="debug" />

   <script>
   jQuery(document).ready(function(){
         // Target your .container, .wrapper, .post, etc.
         jQuery("body").fitVids();
   });
   </script>
</body>
</html>


I've put it after gkPageContent... and the only thing I can see if I use inspect elements is "<div class="newstyle"> <jdoc:include style="gk_style" name="highlight" type="modules">
</jdoc:include></div>"

Can you help me whats wrong? :dry:

EDIT: Here's the website: http://villa-knobelsdorff.de/website/
User avatar
Senior Boarder

teitbite
Fri Aug 26, 2016 9:42 am
Reply with quote
Report this post
Hi

You can see a code of the module position in source, so I believe problem here is with text editor You've used. Basically it got enced and could not me interpreted by joomla. Please send me an access to ftp or just the /layout/default.php file so I'll check.
User avatar
Moderator

GK User
Fri Aug 26, 2016 10:42 am
Reply with quote
Report this post
Hi teitbite :D

I've sent you a PM.
User avatar
Senior Boarder

teitbite
Sat Aug 27, 2016 12:50 pm
Reply with quote
Report this post
Hi

I'm afraid this access is not working. Please check if Poland isn't block from accessing server by any chance.
User avatar
Moderator

GK User
Mon Aug 29, 2016 9:46 am
Reply with quote
Report this post
I'm sorry, I've sent you a download link for the default.php.
User avatar
Senior Boarder

GK User
Mon Aug 29, 2016 11:47 am
Reply with quote
Report this post
imda wrote:I'm sorry, I've sent you a download link for the default.php.

I'm sorry for double post:

I still was troubleshooting why I can't see the new module. Now I just opened the default.php with notepad++ and put the whole code of <jdoc:include style="gk_style" name="highlight" type="modules"> in one row... First I had a break in this code...

It's strange that I can see the module now. :shock: I only need some CSS style that both modules are next to each other. (I want the Highlighter and a custom module in this position)
User avatar
Senior Boarder

teitbite
Wed Aug 31, 2016 11:23 am
Reply with quote
Report this post
Hi

It's not strange. Code needst to be whole for joomla to interpret. If it wasn't recognised because of this break than it was treated as a regular text.

What changes to the module You need and where the site was moved? Old link is showing error 404 no page found message.
User avatar
Moderator

GK User
Thu Sep 01, 2016 9:23 am
Reply with quote
Report this post
teitbite wrote:Hi

It's not strange. Code needst to be whole for joomla to interpret. If it wasn't recognised because of this break than it was treated as a regular text.

What changes to the module You need and where the site was moved? Old link is showing error 404 no page found message.


I see.
I'm not good at using PHP :oops:

The website was moved to the main domain when I finished it. :whistle:

At first I had a little floating problem with the highlighter and the image below the main menu. But now I think the result looks good. :) http://villa-knobelsdorff.de/

Thank you for taking your time. I guess you can mark this thread as solved.
User avatar
Senior Boarder

teitbite
Sun Sep 04, 2016 1:32 pm
Reply with quote
Report this post
Hi

Yes, site looks great now. I'm closing this thread than since everything got resolved.
User avatar
Moderator


cron