×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Adding New Tab

Adding New Tab 13 years 11 months ago #10981

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
1. in components/com_hotspots/views/all/tmpl/default.php
at the end of the file you will find this:

if ($xmlconfig->get( 'addhs_front', 1 ) == 1)
{
echo $pane->endPanel();

echo $pane->startPanel( JText::_( 'Add Hotspot' ), 'addhotspot' );
// Display the parameters defined in the <params> group with the 'group' attribute of 'GROUP_NAME'
//echo $this->params->render( 'params', 'ADVANCED' );
include(JPATH_COMPONENT.DS.'views'.DS.'all'.DS.'tmpl'.DS.'addspot.php');

echo $pane->endPanel();

echo $pane->endPane();
}


2 Read this here:
docs.joomla.org/How_to_use_the_JPane_classes_in_a_component

3. You will know what to do now :)

Adding New Tab 13 years 11 months ago #10993

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

Thanks to point the direction but looks like Chinese to me.

Adding New Tab 13 years 11 months ago #11021

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Right before this line
if ($xmlconfig->get( 'addhs_front', 1 ) == 1)
add this code:
echo $pane->endPanel();
 
echo $pane->startPanel( JText::_( 'test' ), 'test' );
 
echo 'test';
echo $pane->endPanel();

or this one:
echo $pane->endPanel();
 
echo $pane->startPanel( JText::_( 'test' ), 'test' );?>
I have my text here balabl blablabla
<?php
echo $pane->endPanel();

Adding New Tab 13 years 11 months ago #11032

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

Adding that code I got the following error message:

Fatal error: Call to a member function endPanel() on a non-object in /home/eliecer/virtualbc.ca/components/com_hotspots/views/all/tmpl/default.php on line 59

Adding New Tab 13 years 11 months ago #11045

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Have you turned off the option to add hotspots from the frontend???

Adding New Tab 13 years 11 months ago #11068

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

I dunno what you are talking about but
The Autopublish frontend added markers is setup to NO in the configuration setting.

If that's what you meant.

Adding New Tab 13 years 11 months ago #11093

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Go to menu-> your hotspots item and look at the option "Frontend hotspot marker adding" - is it set to yes or to no???

Adding New Tab 13 years 11 months ago #11096

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

the option "Frontend hotspot marker adding" it is set to yes.

Adding New Tab 13 years 11 months ago #11098

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Then you must be doing something wrong. Here is a copy of the whole default.php with the modifications I suggested (I've tested it and it works for me)
<?php
/**
* Hotspots - Frontend
* @package Joomla!
* @Copyright (C) 2010 Daniel Dimitrov - compojoom.com
* @All rights reserved
* @Joomla! is Free Software
* @Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 0.9.3 beta $
**/
defined( '_JEXEC' ) or die ( 'Restricted access' );
JHTML::_('behavior.mootools');
JHTML::_('stylesheet', 'hotspots.css', 'media/com_hotspots/css/');
JHTML::_('script', 'hotspots.js', 'media/com_hotspots/js/');
$params = &$mainframe->getParams();
$xmlconfig = &JComponentHelper::getParams('com_hotspots');
 
// Adding Template Styles & js
 
$doc =& JFactory::getDocument();
$domready = "window.addEvent('domready', function(){ \n";
 
$domready .= hotspotsUtils::maptype();
$domready .= hotspotsUtils::gmcontrols();
$domready .= hotspotsUtils::getJSVariables();
 
$domready .= " effects();
	if (addhs_map) {
		addspot();
	}
 
	if(otherCat != '') {
		hsload(otherCat);
	} else {
		hsload(hs_startcat);
	}
});";
 
$doc->addScriptDeclaration($domready);
 
if (HotspotsHelper::getSettings('show_componentheading', 1) == 1)
{
?>
<!-- START Hotspots by compojoom.com  -->
<div class="componentheading<?php echo $params->get('pageclass_sfx')?>"><?php echo $this->escape($params->get('page_title')); ?></div>
<?php
}
$appl = JFactory::getApplication();
$messages = $appl->getMessageQueue();
if($messages) {
	$messagessplit = $messages[0];
	if ($messagessplit['message'] != "")
	{
		echo "<div class=\"hs_error\">";
		echo $messagessplit['message'];
		echo "</div><br />";
	}
}
if ($xmlconfig->get( 'addhs_front', 1 ) == 1)
{
$pane =& JPane::getInstance( 'tabs',  array('startOffset'=>0));
echo $pane->startPane( 'pane' );
echo $pane->startPanel( JText::_( 'Map' ), 'base' );
}
?>
<br />
<div id="hs_cont" style="height: <?php echo HotspotsHelper::getSettings('category_height', 100); ?>px; <?php if ($xmlconfig->get( 'hs_show_menu', 1 ) == 0) echo "display:none;"?>">
<?php if (HotspotsHelper::getSettings('show_topright_menu', 1) == 1) : ?>
<div id="small_menu"><?php hotspotsUtils::hs_showsmallcategories(); ?></div>
<?php endif; ?>
<?php hotspotsUtils::hs_catinfo(); ?>
 
<div id="hs_topmenu">
<?php hotspotsUtils::hs_showcategories(); ?>
</div>
</div>
 
<div id="map_cont" style="height: <?php echo (HotspotsHelper::getSettings('map_height', 600) + 10); ?>px;">
<div id="map_canvas" class="map_canvas" style="width: <?php if (HotspotsHelper::getSettings('map_border_watcher', 0) == 1) { echo "98"; } else { echo "100"; } ?>%; height: <?php echo HotspotsHelper::getSettings('map_height', 600);?>px;"></div>
<?php
	// Suggested border colors: white= cdcdcc, blue=7a98c9, red 8d2827, yellow= cbc276, black: 272726;
	$map_overlay_bg =  'map_overlay_' . HotspotsHelper::getSettings('map_overlay_bg', 'white') . '.png';
	$map_overlay_border = HotspotsHelper::getSettings('map_overlay_border', '4px solid #cdcdcc');
?>
<div id="map_overlay_cont" style="background: url('media/com_hotspots/images/utils/<?php echo $map_overlay_bg; ?>') repeat; border-top: <?php echo $map_overlay_border; ?>; <?php if (HotspotsHelper::getSettings('map_overlay_div', 1) == 0) { echo " display: none;"; } ?>">
<div id="map_overlay_close">
	<a id="close_mapoverlay" href="#" onclick="document.getElementById('map_overlay_cont').style.display = 'none'; return false;">
		<?php echo JText::_('Close'); ?>
	</a>
</div>
<div id="map_overlay"></div>
</div>
 
<?php echo $this->loadTemplate('routenplaner'); ?>
 
<?php echo $this->loadTemplate('menu'); ?>
</div>
 
<?php if (HotspotsHelper::getSettings('routenplaner', 1)) : ?>
<div id="routenplaner">
    <p align="right"><a href="javascript:routeplan_close();"><?php echo JText::_('Close'); ?></a></p>
</div>
<?php endif; ?>
<?php if(HotspotsHelper::getSettings('show_welcome_text', 1) == "1") : ?>
    <div id="hswelcome" onclick="hswelcomeClose();">
		<div style="margin:10px;">
			<div style="float:right;">
				<img src="media/com_hotspots/images/utils/close.gif" width="14" height="13" alt="close"/>
			</div>
			<div class="hs_welcome"></div>
		   <?php echo HotspotsHelper::getSettings('welcome_text', 'You should not see this'); ?>
		</div>
    </div>
<?php endif; ?>
	<div id="hsloading">
        <div style="width:60px; height:60px; margin-left: auto; margin-right: auto; margin-top: 90px; text-align: center; vertical-align:middle;">
           <img src="media/com_hotspots/images/utils/loader.gif" alt="<?php echo JTEXT::_('Loading');?>" />
           <br /><?php echo JTEXT::_('Loading');?>
		</div>
    </div>
	<?php
	// DEBUG FUNKTION
	if (HotspotsHelper::getSettings('debug', 0) == 1) {
		echo "<div id=\"message\"></div>\n";
	}
	?>
<script type='text/javascript'>
/* <![CDATA[ */
 
<?php
if ($xmlconfig->get( 'map_centertyp', 1 ) == 0)
{
    echo "var Position = new GLatLngBounds();\n";
    echo "var centertype = 1;\n";
} else {
    echo "var Position = null;\n";
    echo "var centertype = 0;\n";
}
?>
/* ]]> */
</script>
 
<br />
<?php echo $this->loadTemplate('footer_info'); ?>
<?php
// DEBUG FUNKTION
if (HotspotsHelper::getSettings('debug', 0) == 1) {
echo "<input type=\"button\" id=\"mybutton\" name=\"mybutton\" value=\"Click Me\" onclick=\"hsload(1)\" />\n";
}
 
echo $pane->endPanel();
 
 
 
echo $pane->startPanel( JText::_( 'test' ), 'test' );
 
 
 
echo 'test';
 
echo $pane->endPanel();
 
if ($xmlconfig->get( 'addhs_front', 1 ) == 1)
{
echo $pane->endPanel();
 
echo $pane->startPanel( JText::_( 'Add Hotspot' ), 'addhotspot' );
// Display the parameters defined in the <params> group with the 'group' attribute of 'GROUP_NAME'
//echo $this->params->render( 'params', 'ADVANCED' );
include(JPATH_COMPONENT.DS.'views'.DS.'all'.DS.'tmpl'.DS.'addspot.php');
 
echo $pane->endPanel();
 
echo $pane->endPane();
}
 
echo $this->loadTemplate('footer');
?>
 
<!-- End Hotspots by compojoom.com  -->

Adding New Tab 13 years 11 months ago #11100

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

I don't get the error anymore but I don't see the new tab any place.

Adding New Tab 13 years 11 months ago #11104

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
clear your browser cache. The tab have to be between map and add map.

Adding New Tab 13 years 11 months ago #11105

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

I clear the cache in 4 different browsers and I tested it in 3 different computers.

There is nothing showing up between the Map's Tab and the Add hotspot's Tab.

And, I am using the code you pasted. Is there any place in the code to set up the number of tabs?

Adding New Tab 13 years 11 months ago #11106

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
give me a link to your page please.

Adding New Tab 13 years 11 months ago #11107

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

the link is www.virtualbc.ca

Adding New Tab 13 years 11 months ago #11109

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Are you using template overrides for this? If yes you have to enter the code in override and not in components/com_hotspots/view/all/defualt.php

Adding New Tab 13 years 11 months ago #11110

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Yes, I am using a template.
But I don't know what you mean with you have to enter the code in override

Adding New Tab 13 years 11 months ago #11112

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Judging by your answer I guess that you don't use overrides, but read this docs.joomla.org/How_to_override_the_outp...rom_the_Joomla!_core and make sure that you understand it.

Would you send me ftp access to your website? I need to look at the files. (use the pm function or send me an e-mail)

Adding New Tab 13 years 11 months ago #11165

  • Hartmut Kunst
  • Hartmut Kunst's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 48
  • Thank you received: 0
Hi Daniel,

could you solve this issue?

I would like to add tabs also, tried out the above and had the same results.

Finally no error message but also no new tab ;-(

Best Regards
Hartmut

Adding New Tab 13 years 11 months ago #11166

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, i think I know what is wrong :D:D:D:D:D:D:D:D:D:D:D:D:D

Look again at what I wrote above: compojoom.com/forum/27-hotspots/52-newbi...dding-new-tab#p11021

The problem is that there are several lines with this code
if ($xmlconfig->get( 'addhs_front', 1 ) == 1)

In the template :) I was refering to the last one - around line 140-160.
I just placed this code
echo $pane->endPanel();
 
 
 
echo $pane->startPanel( JText::_( 'test' ), 'test' );
 
 
 
echo 'test';
 
echo $pane->endPanel();
on your site eliecer and you have already a new tab.

Cheers,
Daniel

Adding New Tab 13 years 11 months ago #11176

  • Hartmut Kunst
  • Hartmut Kunst's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 48
  • Thank you received: 0
Hi,

I have a new tab too now :-)

But now... ?

This temptates me to express a wish.

See "Wishlist"

Best Regards
Hartmut
  • Page:
  • 1
  • 2
Time to create page: 0.141 seconds