[pmwiki-users]SEO: Avoiding Headings in the SideBar

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 15 19:26:34 CDT 2005


On Mon, Aug 15, 2005 at 05:05:02PM -0700, H. Fox wrote:
> On 8/15/05, Hans <design at flutesong.fsnet.co.uk> wrote:
> > One could create markup do do this translation, but we cannot have
> > markup which only translates this if it is in the sidebar, since the
> > sidebar is treated just like any page.
> 
> Oh.  I was thinking you could do something like
> 
>     if ($Name == 'SideBar') {
>       Markup([...]);
>     }

Not exactly like this, because in config.php the pagename always
refers to the page being displayed in the main contents, not the
sidebar or other included content.

What would have to happen is that the !!! markup rule would have to check
the value of the local $pagename and decide whether to return
<hn> or something else:

    Markup('^!', 'block',
      '/^(!{1,6})\\s?(.*)$/e',
      "(substr(\$pagename,-8) == '.SideBar') ?
          '<:block><div class=\"someclass'.strlen('$1').PSS('\">$2</div>') :
          '<:block><h'.strlen('$1').PSS('>$2</h').strlen('$1').'>'"); 

Or something like that.

Pm




More information about the pmwiki-users mailing list