Talk: Vector
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
PHP Compatibility Warnings
My web host is soft-forcing everyone to upgrade their websites to PHP 8.1 and in the process I noticed that I was getting some warnings being thrown in my error log that seem to indicate some PHP compatibility issues. Some of them are as follows, but it's the same format about undefined keys and variables:
* PHP Warning: Undefined variable $ScriptUrl
in (sitepath)/pub/skins/vector/vector.php on line 104
- PHP Warning: Undefined array key "title" in (sitepath)/pub/skins/vector/vector.php on line 65
- PHP Warning: Undefined array key "pagename" in (sitepath)/pub/skins/vector/vector.php on line 252
- PHP Warning: Undefined array key "pagename" in (sitepath)/pub/skins/vector/vector.php on line 224
Currently running pmwiki version 2.3.23. I know it's been a while since this skin has gotten an update, but I'm hoping there may be a fix so my error log stops getting spammed! The skin itself seems to work fine otherwise. Kat, May 15 2023, at 11:45 PM
Hi. Try to contact the maintainer directly, as it is not certain he actively monitors this page. You will find his email at the bottom of his profile page. --Petko
Question marks on un-made pages
Is there a simple way to get question marks after un-made pages so we know which pages still need content, like standard pmwiki skin?
naturewiki
The link New page is already underlined with a dotted line. To add a question mark, you can add to your file pub/css/local.css (create it if it doesn't exist) the following snippet. --Petko December 09, 2020, at 05:54 AM
a.createlinktext::after { content: '?'; vertical-align: super; font-size: small; }
November 17th 2020
I'm having an issue with using the Talk tab (to the right of the Article tab) that appears on top of the page . I've followed the Vector install (here) ensuring that path info is enabled ($EnablePathInfo
= 1;) in config.php.
When I click the Talk tab it returns a 404 Not Found. Looking at the URL of the talk page, the format is wrong. My script URL is server/wiki
but when I use the Talk tab on a page it goes to server/My/Page-Talk
removing the "/wiki/"
from the URL. I don't see any way to configure this but if there is and I missed it, I apologize.
Page URL | -Talk URL |
server/wiki/My/Page - Works!
| server/My/Page-Talk - Fails! 404 Not Found
|
Thanks for the awesome skin!
--
James B.
# If {$FullName} is 'Group.Page-Talk' then {$BaseName} is 'Group.Page' $BaseNamePatterns['/-Talk$/'] = '';gb November 19, 2020, at 06:28 PM
Talk
tab (next to the Article
tab) on a page. It drops part of the URL. My $ScriptURL
is like this: http://server/wiki
. So viewing page http://server/wiki/Group/Page
is fine but the Talk
tab sends you to http://server/Group/Page-Talk
. Somehow, the it drops the "/wiki/"
. Would simply adding that dropped part of the URL (/wiki/) to the $BaseNamePatterns
work? I.e., $BaseNamePatterns
['wiki/-Talk$/'] = ;
. Rather than what is already in vector.php
which is: $BaseNamePatterns
['/-Talk$/'] = ;
. Thanks again. --James B.
There is an omission in vector.php in the RenderTalkSelector() function the $ScriptUrl
variable was not declared global. You should try adding this line. --Petko November 21, 2020, at 05:01 AM
function RenderTalkSelector($pagename) { global $ScriptUrl; ### Line added.
Thank you so much!!! Adding the follwing line to the RenderTalkSelector function in the stock vector.php
worked:
function RenderTalkSelector($pagename) { global $ScriptUrl; ### Line added.
--
James B.
--
Awesome find Petko I also had the same problem and this fixed it. Perhaps we could get an update of this cookbook so people don't have to modify the file for it to work?
naturewiki
Page URLs in RenderTalkSelector
Some of the links are constructed in non-standard PmWiki way, by using $ScriptUrl
/$pagename
rather than $PageUrl. This may not work well if $EnablePathInfo
is not set, and produces URLs that are different from the standard, e.g. Server/Group.Page
from the skin unlike Server/Group/Page
(from a regular link). Linking different URLs pointing to the same content is search-engine unfriendly. The following modification of the function RenderTalkSelector may work better:
function RenderTalkSelector($pagename) { $basename = PageVar($pagename, '$BaseName'); $baseurl = PageVar($basename, '$PageUrl'); $talkname = "$basename-Talk"; $talkurl = PageVar($talkname, '$PageUrl'); $out = " <ul id='article-talk-selector'>\n"; if ($talkname == $pagename) { $out .= " <li><a href='$baseurl'>Article</a>\n"; $out .= " <li><p class='active'>Talk</p>"; } else { $out .= " <li><p class='active'>Article</p>\n"; $out .= " <li><a href='$talkurl'>Talk</a>\n"; } $out .= " </ul>"; print $out; }
I have not checked other functions of this skin which may or may not need a similar fix. --Petko November 21, 2020, at 05:39 AM
Logos in mobile or condensed view
When viewing in fullscreen browser, custom logo image is displayed, but when the browser is condensed or viewed in mobile mode, it reverts back to PMWiki logo. Thanks for the great skin! John M
It appears you need to set the variable $PageLogoAltUrl
the same as $PageLogoUrl
, or a different logo that may be more appropriate for the mobile view. --Petko
This fixed it, thank you for your assistance! John M
Changing header text?
Level 1 headers (!) and Level 3 headers (!!!) appear to be in a different font than Georgia, was wondering what's the best method to change this. Additionally, I'm not seeing the box to check for 'This is a minor edit;' I can see the text but the check box isn't there. Thanks for all your help! Jimbo
The skin appears to hide the minor edit checkbox. Here is how to restore it, and to make the headers with the same font. Create a file pub/css/local.css if it doesn't exist, and add to it these styles. --Petko
h1, h2, h3, h4, h5, h6 { font-family: Georgia, serif; } #wikiedit input[name="diffclass"] { visibility: visible; }
Fixed, thanks for your assistance Petko! Jimbo
Light/Dark theme toggle
Hello! Any way to get the light/dark theme toggle working on this skin? I'm sure there's a line of code I can borrow from the default skin, but not sure where to begin looking. Thank you for all of your help! Jimbo