Okay, I've tested every single panel on my wiki, and I came to realize
that some of the panels do behave properly (maintain their
collapsed-status while browsing the wiki).
Actually, all panels from the left panel-column and about half of the
right panel-column do not behave properly. I do not understand this
behaviour, since most of them have the same code, which is an
adaptation of the regular panelheader macro:
#macro(collapsedpanelheader $title)
#set($cookieName = "${context.user}_${panel}")
#set($expanded = "collapsed")
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
## Note: We pass the Panel name as an HTML class attribute so that
it's possible to style
## the Panels selectively using CSS.
#set ($specialClassAttribute = "")
#if ($paneldoc && $paneldoc != "")
#set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
#end
<div class="panel $expanded $specialClassAttribute">
<h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode,
'collapsed')) createCookie('$cookieName','expanded', '');
else
eraseCookie('$cookieName');
togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
I have no experience with cookies, but I feel that the only thing that
may be wrong here is on the tag <h5>, and I may have the "expanded"
swaped with "collapsed". Changed that, and got the same behaviour.
Finally, even a panel which uses the standard panelheader does not
behave properly.
Does anybody have a possible explanation / common problems?
best regards,
Joao
On 10/03/2008, Joao Henrique Silva Santos <joao.s.santos(a)gmail.com> wrote:
I've opened again the the macros.vm file, and in
fact the lines
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
and
onclick="if(eltHasClass(this.parentNode, 'expanded'))
createCookie('$cookieName','collapsed', ''); else
eraseCookie('$cookieName');
togglePanelVisibility(this.parentNode);">$title</h5>
do seem to control the collapsed status.
However, I do not get that behaviour
Joao
On 07/03/2008, [Ricardo Rodriguez] Your EPEC Network ICT Team
<webmaster(a)environmentalchange.net> wrote:
Hi João,
Joao Henrique Silva Santos wrote:
I want to maintain the "expanded/collapsed"-status of my panels when
surfing my xwiki.
I've seen the post
http://lists.xwiki.org/pipermail/users/2008-March/010746.html
:
I think it would be ok to follow the original thread ;-)
To maintain the status while surfing the wiki is the default behavior. Do
you get a different thing? Does your browser accept cookies?
However, I can't see the code used for XWiki panels since I can't
enter edit mode.
I really want to see how to implement those cookies, so if I'm looking
in the wrong place, where can I search it?
I read "your wiki", thus if you have installed it I don't understand why
can you not enter edit mode? Even tough you have installed the default .xar,
you can gain access by using Admin as username and admin as pasword. See
this...
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation#HInstallin…
The code controlling status cookies is in macro.vm template. Look for it in
the /templates folder under /xwiki. You must want to find macros panelheader
and largepaneheader.
Hope this helps,
Ricardo
--
Ricardo Rodríguez
Your EPEC Network ICT Team
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users