Extension talk:DynamicSkin

Vector based edit

Did anyone create a Vector based template, which works with the new Mediawiki Editor?

Changes to To Work With MediaWiki 1.19 edit

Trying to use the DynamicSkin Extension gives two errors (so far) on MediaWiki 1.19:

  • tooltipAndAccesskey is undefined
  • an error saying that cache cannot be disabled

The following changes fixed these problems:

--- DynamicSkin.php.orig	2012-07-23 22:49:55.000000000 -0700
+++ DynamicSkin.php	2012-07-24 10:17:23.775672475 -0700
@@ -225,7 +225,7 @@
             $out .= '<a style="background-image: url(';
             $out .= !empty($args) ? $args : $this->otext('logopath');
             $out .= ');" href="' . htmlspecialchars($this->data['nav_urls']['mainpage']['href']) . '"';
-            $out .= $skin->tooltipAndAccesskey('n-mainpage') . '></a></div>';
+            $out .= $skin->tooltipAndAccesskeyAttribs('n-mainpage') . '></a></div>';
             $out .= '<script type="'.$JSMIME.'"> if (window.isMSIE55) fixalpha(); </script>';    // <!-- IE alpha-transparency fix -->
             return( $out );
  
@@ -258,7 +258,7 @@
         case 'SEARCH':          // Search button(s)
             $out .= $this->startPortlet( 'p-search', 'search', 'searchBody', 'searchInput' )
                  .  '<form action="' . $this->otext('searchaction') . '" id="searchform"><div>'
-                 .  '<input id="searchInput" name="search" type="text"' . $skin->tooltipAndAccesskey('search')
+                 .  '<input id="searchInput" name="search" type="text"' . $skin->tooltipAndAccesskeyAttribs('search')
                  .  ( (isset($this->data['search'])) ? ' value="' . $this->otext('search') . '"' : '' )
                  .  ' />';
             if ( !stristr($args,'go') && !stristr($args,'se'))   $args .= ',go,search';   // Default if only 'image' was specified
@@ -330,7 +330,7 @@
                 $out .= '<li id="feedlinks">';
                 foreach ($this->data['feeds'] as $key => $feed) {
                     $out .= '<span id="feed-' . Sanitizer::escapeId($key) . '">'
-                         .  '<a href="' . htmlspecialchars($feed['href']) . '"' . $skin->tooltipAndAccesskey('feed-'.$key) . '>'
+                         .  '<a href="' . htmlspecialchars($feed['href']) . '"' . $skin->tooltipAndAccesskeyAttribs('feed-'.$key) . '>'
                          .  htmlspecialchars($feed['text']) . '</a>&nbsp;</span>';
                 }
                 $out .= '</li>';
@@ -382,11 +382,11 @@
             return( $this->data['displaytitle']!="" ? $this->ohtml('title') : $this->otext('title') );
  
         case 'USERGROUPS':             // &&USERGROUPS&& pseudo-variable: Groups this user belongs to
-            $wgParser->disableCache(); // Mark this content as uncacheable
+            # $wgParser->disableCache(); // Mark this content as uncacheable
             return( implode( ",", $wgUser->getGroups() ) );
  
         case 'USERID':                 // &&USERID&& pseudo-variable: User Name, blank if anonymous
-            $wgParser->disableCache(); // Mark this content as uncacheable
+            # $wgParser->disableCache(); // Mark this content as uncacheable
             // getName() returns IP for anonymous users, so check if logged in first
             return( $wgUser->isLoggedIn() ? $wgUser->getName() : '' );
  
@@ -454,7 +454,7 @@
         if ( !empty($href) ) {
             $out .= '<a href="' . htmlspecialchars($href) . '"';
             if ( !empty($hclass) ) $out .= ' class="' . htmlspecialchars($hclass) . '"';
-            if ( !empty($id) )     $out .= $skin->tooltipAndAccesskey($id);
+            if ( !empty($id) )     $out .= $skin->tooltipAndAccesskeyAttribs($id);
             $out .= '>';
         }        
         $out .= htmlspecialchars($text);

Edit: Disabling the Cachelines gives weird behaviour. Sometimes I get logged out, but Mediawiki still serves pages as If I were still logged in. Investigating with Mediawiki 1.17.

Sidebar edit

I've been able to get dynamic skins to switch sidebars based on namespace but i am having problems with having multiple areas within the sidebar. For instance on this page there is a section for site, a section for download, a section for support etc. Usually in MediaWiki:Sidebar you can get this effect by using bulleted lists 1 * for a header above the box (*) and 2 * for items within the box (**) If i do that in a dynamicskin sidebar, the one labled navigation shows up properly but each additional header, whether before or after navigation shows up with the ascii code for < preceding the header and the ascii code for > following.

Has anyone had any success with making sidebars with multiple sections without ascii code appearing in the headers?

Kay

I'm relatively new to using MediaWiki (trying to build a large, extended-family website), and I hit this problem as well. I've looked back here a couple times to see if anyone has answered your Kay's original question, without luck. For what it's worth, I'd also be interested in an answer to this problem.

~Nathan

Doesnt work for edit

I mediawiki 1.14 installed . And it doesn't work .

CATEGORIES edit

I noticed that the code listed for the &&CATEGORIES&& pseudo-variable is incomplete. For me, if I attempted to use the variable in the sidebar or elsewhere, the page displayed an error stating that a non-object was attempting to access the getCategories() function. Looking at the code, I noticed that there is no local definition in the translate_variable function for the variable &skin. In short, I simply added "$skin = $wgUser->getSkin();" to the top of the translate_variable function, and everything worked perfectly. In sort I made it look like so:

...
...
# Returns HTML text for the specified pseudo-variable
    function translate_variable( $tag )
    {
        global $wgParser, $wgUser;
	$skin   = $wgUser->getSkin();

        switch ( strtoupper($tag) ) {
...
...

Hope that helps!

Cheers, ~Nathan

Return to "DynamicSkin" page.