[pmwiki-users] Redesigning for accessibility: heading levels?
Petko Yotov
5ko at 5ko.fr
Thu Sep 17 02:19:31 PDT 2020
On 16/09/2020 18:25, Steve Glover wrote:
> Is there a way, please, to include one line of text if a page is
> rendered alone but another if it's rendered inside a holding page?
There are several ways to do it.
I suggest looking into the recipe SectionEdit which creates "edit" links
directly to the included pages, by overriding the "(:include...:)"
markup.
Another way would be to add a $QualifyPattern that inserts a link to the
included page at the beginning. Something like this:
$QualifyPatterns['/^/'] = "IncludeWithLink";
function IncludeWithLink() {
foreach(debug_backtrace() as $a) {
if($a['function'] == 'IncludeText') # prevent PTVs
return '(:nl:)%rfloat red
bgcolor=yellow%[[{$Name}?(action=)edit]]%%(:nl:)';
}
return '';
}
This will show a red on yellow link "OtherPage?edit", floating right, at
the beginning of the included text.
Note that PmWiki includes group headers and footers and you will see a
link to these too. Also some pagelists or inline templates, or skins,
use the include markup.
I'd enable this as a temporary measure while I review the pages.
A third way could be to override the Heading markup rule, so that the
first processed heading markup always becomes a H1 heading.
Petko
On 16/09/2020 18:25, Steve Glover wrote:
> Hi,
>
> One of the things I've come across when remodelling a PmWiki-based
> site to fit with accessibility guidelines is the rather stricter rules
> on header levels than I've been used to.
>
> I can use a bulk search and replace on pages in the wiki.d folder to
> ensure that each page starts with a first level header - that bit's
> easy enough - but where I hit a problem is when I have one page that
> includes others.
>
> Is there a way, please, to include one line of text if a page is
> rendered alone but another if it's rendered inside a holding page?
More information about the pmwiki-users
mailing list