<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Sidepanel plugin always redirects to itself at login</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Wed, 15 Apr 2026 06:26:50 -0000</pubDate>

		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>No problem at all, you really helped me  lot getting this done.<br />
I knew we were close to getting it to work so spending some time looking at the code is good for my expereince. After doing all possible changes to the tpl I soon figured the issue was elsewhere ;)</p>
]]></description>
			<pubDate>Mon, 28 Oct 2013 17:57:53 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38253]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>Ah, sorry. Overlooked that.</p>
]]></description>
			<pubDate>Mon, 28 Oct 2013 16:07:51 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38251]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>I had to comment out the following line in sidepanel.php<br />
 </p>

<pre class="brush:php;">
// $t-&gt;parse(); disabled otherwise the contents of tpl shows 2x</pre>

<p><br />
 </p>

<p>Now it properly works and allows me to use the conditions etc. Thanks for all the help!!</p>
]]></description>
			<pubDate>Mon, 28 Oct 2013 16:00:50 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38250]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>Try to build up your sidepanel.tpl file from scratch, I think it's in there.</p>

<p>I've never used this Extruder thing before, so I can't be of much more assistence.</p>
]]></description>
			<pubDate>Wed, 23 Oct 2013 02:47:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38224]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums?m=posts&amp;q=7561#38222">#38222</a> <strong>Twiebie: </strong>
<p>Remove:</p>

<pre class="brush:xml;">
&lt;div class="content"&gt; &lt;/div&gt;
</pre>
</blockquote>

<p> </p>

<p>Sorry, it must be cause its late but that class is not present as far as I can tell. Not in the sidepanel tpl at least and also not in the php. I am not sure where you want me to remove it from?<br /><br /><br />
Thanks for the info on the "r", thats very usefull and I will try to remember that :)</p>
]]></description>
			<pubDate>Wed, 23 Oct 2013 02:10:18 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38223]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>Remove:</p>

<pre class="brush:xml;">
&lt;div class="content"&gt; &lt;/div&gt;</pre>

<p>The 'r' is so that it doesn't include header.php and footer.php.</p>
]]></description>
			<pubDate>Wed, 23 Oct 2013 01:22:18 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38222]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>It is almost working right, I will get to that at the end.<br /><br />
First, thank you very much for pointing me in the right direction!!<br />
If it is not to much asked, why does the hook have to be ajax? And yes indeed, why is the "e" replaced with an "r"? I gues both things are connected?<br /><br /><br />
Now, about this almost working right.<br />
I have applied the changes you wrote above and it is working correctly, no more redirects after login. However, the output from the tpl is now done twice, it is looping 2x so to say. That means I see the same menu 2 times underneath eachother.<br />
Could this have to be cause it is now ajax? Should I put it in an ajx block and add the ajax class to the url?<br />
As described here: <a href="http://www.cotonti.com/docs/devel/ajax_helpers">http://www.cotonti.com/docs/devel/ajax_helpers</a></p>
]]></description>
			<pubDate>Wed, 23 Oct 2013 01:06:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38221]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>If you want to do it with a plugin you should set the hook to ajax.</p>

<p>Call it like this:</p>

<pre class="brush:php;">
&lt;?php defined('COT_CODE') or die('Wrong URL');
/* ====================
  [BEGIN_COT_EXT]
  Hooks=ajax
  [END_COT_EXT]
  ==================== */

$t = new XTemplate(cot_tplfile('sidepanel', 'plug'));

$t-&gt;parse();
$t-&gt;out();</pre>

<pre class="brush:xml;">
&lt;!-- sidebar stuff --&gt;
&lt;div id="extruderRight" class="{title:'User Control Panel', url:'index.php?r=sidepanel'}"&gt;&lt;/div&gt;</pre>

<p>Note the index.php?<u><strong>r</strong></u>=sidepanel</p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 22:04:35 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38220]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>In my first post I linked you to the source, you can use that in case you need more. I can only paste here my edits I have made but posting all js files is not needed I guess?<br /><br />
In the footer I have the following: </p>

<pre class="brush:xml;">
&lt;!-- sidebar stuff --&gt;
	&lt;!-- &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"&gt;&lt;/script&gt; --&gt;
	&lt;script type="text/javascript" src="https://www.cotonti.com/inc/jquery.hoverIntent.min.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="https://www.cotonti.com/inc/jquery.mb.flipText.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="https://www.cotonti.com/inc/mbExtruder.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript"&gt;

		$(function(){
			if (self.location.href == top.location.href){}
			$("#extruderRight").buildMbExtruder({
				position:"right",
				width:300,
				extruderOpacity:.8,
				textOrientation:"tb",
				onExtOpen:function(){},
				onExtContentLoad:function(){},
				onExtClose:function(){}
			});
		});
	&lt;/script&gt;
&lt;!-- &lt;div id="extruderRight" class="{title:'User Control Panel ', url:'parts/extruderRight.html'}"&gt;&lt;/div&gt; --&gt;
&lt;div id="extruderRight" class="{title:'User Control Panel', url:'index.php?e=sidepanel'}"&gt;&lt;/div&gt;</pre>

<p> </p>

<p>Than I have my sidepanel setup php file: </p>

<pre class="brush:php;">
&lt;?php
/* ====================
[BEGIN_COT_EXT]
Code=sidepanel
Name=sidepanel
Category=User control panel
Description= A sidepanel you can use as a user control area.
Version=1.0
Date=2013-10-22
Author=
Copyright=
Notes=
Auth_guests=RW
Lock_guests=12345A
Auth_members=RW
Lock_members=12345A
[END_COT_EXT]
==================== */

/**
 * Sidepanel Plugin for Cotonti CMF
 *
 * @package sidepanel
 * @version 1.0
 * @author
 * @copyright (c)
 * @license BSD
 */
?&gt;</pre>

<p> </p>

<p>Than my sidepanel.php: </p>

<pre class="brush:php;">
&lt;?php

/* ====================
  [BEGIN_COT_EXT]
  Hooks=standalone
  [END_COT_EXT]
  ==================== */

/**
 * Sidepanel Plugin for Cotonti CMF
 *
 * @package sidepanel
 * @version 1.0
 * 
 * @copyright (c)
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');

$tplfile = cot_import('tpl', 'G', 'TXT');
$mskin = cot_tplfile(array('sidepanel', $tplfile), 'plug');
$t = new XTemplate($mskin);

?&gt;
</pre>

<p> </p>

<p>And I have this is my sidepanel.tpl </p>

<pre class="brush:xml;">
&lt;!-- BEGIN: MAIN --&gt;
&lt;!--
  ~ /*******************************************************************************
  ~  jquery.mb.components
  ~  file: extruderRight.html
  ~
  ~  Copyright (c) 2001-2013. Matteo Bicocchi (Pupunzi);
  ~  Open lab srl, Firenze - Italy
  ~  email: matteo@open-lab.com
  ~  site: 	http://pupunzi.com
  ~  blog:	http://pupunzi.open-lab.com
  ~ 	http://open-lab.com
  ~
  ~  Licences: MIT, GPL
  ~  http://www.opensource.org/licenses/mit-license.php
  ~  http://www.gnu.org/licenses/gpl.html
  ~
  ~  last modified: 04/01/13 17.13
  ~  ******************************************************************************/
  --&gt;

&lt;div class="voice {}"&gt;&lt;span class="label"&gt;&lt;a class="label" href="http://www.open-lab.com"&gt;Open Lab&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id="tw" class="voice {panel:'parts/extr.tw.html'}"&gt;&lt;a class="label" href="http://twproject.com" target="_blank"&gt;teamwork&lt;/a&gt;&lt;/div&gt;
&lt;div class="voice {panel:'parts/extr.mti.html'}"&gt;&lt;span class="label"&gt;Morethanicons&lt;/span&gt;&lt;/div&gt;
&lt;!-- IF {PHP.usr.isadmin} --&gt;
	&lt;div class="voice {panel:'parts/extr.network.html'}"&gt;&lt;span class="label"&gt;Only admins can see this&lt;/span&gt;&lt;/div&gt;
&lt;!-- ENDIF --&gt;
&lt;div class="voice {disabled:true}"&gt;&lt;span class="label"&gt;Microsoft Internet Explorer&lt;/span&gt;&lt;/div&gt;
&lt;div class="voice {}"&gt;&lt;a class="label" href="http://firefox.com" target="_blank"&gt;get FireFox&lt;/a&gt;&lt;/div&gt;
&lt;div class="voice {}"&gt;&lt;a class="label" href="http://www.google.com/chrome" target="_blank"&gt;get Chrome&lt;/a&gt;&lt;/div&gt;
&lt;div class="voice {}"&gt;&lt;a class="label" href="http://www.apple.com/safari/" target="_blank"&gt;get Safari&lt;/a&gt;&lt;/div&gt;
&lt;div class="voice {}"&gt;&lt;a class="label" href="http://www.opera.com/" target="_blank"&gt;get Opera&lt;/a&gt;&lt;/div&gt;

&lt;script type="text/javascript"&gt;&lt;/script&gt;

&lt;!-- END: MAIN --&gt;</pre>

<p><br />
In the tpl I made one if statement purely for testing. Since it works my plugin actually works, except for tht redirect to its standalone page after succesfull login.<br />
Please bare in mind, I do not really understand so much about making plugins, I am always reading and trying till I drop ;)</p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 18:46:48 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38217]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>Can you show the rest of your code, because at the moment I'm a bit confused.</p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 18:26:41 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38216]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>Uhm, yes. That is why I made it a tpl. It needs to be a tpl to work with the <span style="color:rgb(68,68,68);font-family:sans-serif;background-color:rgb(238,238,238);">xtemplate.<br />
The issue is not with that.</span></p>

<p> </p>

<p><span style="color:rgb(68,68,68);font-family:sans-serif;background-color:rgb(238,238,238);">The issue is with the fact this plugin causes a user to be (re)directed to "index.php?e=sidepanel" after succesfull login. And of course it should not do that. I would like to know how to prevent that.<br />
sidepanel is the plugin I created for this.<br />
I tried to make the plugin global instead of standalone but than it wont work at all.</span><br />
 </p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 18:08:23 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38215]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>You can do that in the TPL aswell.</p>

<pre class="brush:xml;">
&lt;!-- IF {PHP.usr.id} &gt; 0 --&gt;
Show something
&lt;!-- ENDIF --&gt;</pre>

<p>Have a look at: <a href="http://www.cotonti.com/docs/ext/themes/">http://www.cotonti.com/docs/ext/themes/</a></p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 17:36:41 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38214]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>I need this to work with xtemplate as I plan to use this as the user control panel, for his PM's, his profile and a lot more. I only want to show the content the member has access to in that panel. Thats why I figured I had to make it a plugin with its own tpl so I can use if, else statements etc ;)</p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 17:05:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38213]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>If I correctly understand what your goal is, I don't think you need a plugin for this.</p>

<p>Simply code it as explained in the documentation on their website.</p>

<p>If you want to use a seperate TPL for it you could include it with: {FILE "{PHP.cfg.themes_dir}/{PHP.usr.theme}/tpl/foobar.tpl"}</p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 16:48:31 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38212]]></link>
		</item>
		<item>
			<title>foxhound</title>
			<description><![CDATA[<p>Working on a new plugin, pretty simple probably but its actually the first one I ever got to work. :)<br />
However, the plugin seems to have the nasty habit to redirect a users login to itself. With that I mean if a user is browsing the website and wishes to login after doing so the site will direct him to the plugin page "index.php?e=sidepanel".<br />
The plugin itself is really simple, with the default setup file (sidepanel.setup.php), which is empty except the minimal requirements and in my sidepanel.php I have the following: </p>

<pre class="brush:php;">
&lt;?php

/* ====================
  [BEGIN_COT_EXT]
  Hooks=standalone
  [END_COT_EXT]
  ==================== */

/**
 * Contact Plugin for Cotonti CMF
 *
 * @package contact
 * @version 2.1.0
 * @author Cotonti Team
 * @copyright (c) Cotonti Team 2008-2013
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');

$tplfile = cot_import('tpl', 'G', 'TXT');
$mskin = cot_tplfile(array('sidepanel', $tplfile), 'plug');
$t = new XTemplate($mskin);

?&gt;
</pre>

<p> </p>

<p>The sidepanel is created in my footer with the following code: </p>

<pre class="brush:xml;">
&lt;div id="extruderRight" class="{title:'User Control Panel', url:'index.php?e=sidepanel'}"&gt;&lt;/div&gt;
</pre>

<p>Yes, I am using "redirect back on login" and I made 100% sure I am not actually on the plugin page.<br />
Is there also a way to prevent from people accessing that "index.php?e=sidepanel"? Cause I have to make it standalone else it does not work, but than you can access it in a standalone page (obviously) which will than show the contents of my tpl in a page.</p>

<p> </p>

<p><span style="line-height:1.6em;">I am trying to make a plugin for this sitepanel: </span><a href="http://pupunzi.com/#mb.components/mb.extruder/extruder.html" rel="nofollow" style="line-height:1.6em;">http://pupunzi.com/#mb.components/mb.extruder/extruder.htm</a></p>
]]></description>
			<pubDate>Tue, 22 Oct 2013 16:26:01 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7561&d=0#post38211]]></link>
		</item>
	</channel>
</rss>