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

H. Fox haganfox at gmail.com
Mon Aug 15 19:42:02 CDT 2005


On 8/15/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Mon, Aug 15, 2005 at 04:25:11PM -0700, H. Fox wrote:
> > How would I cause these
> > [...]
> 
>     Markup('^!', 'block',
>       '/^(!{1,6})\\s?(.*)$/e',
>       "'<:block><div class=\"someclass'.strlen('$1').PSS('\">$2</div>')");

Thanks.

On 8/15/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> 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.

This has the same effect as what I tried (in skin.php), which was

    $page_array = explode('.',$pagename);
    if ($page_array[1] == 'SideBar') {
    Markup('^!', 'block',
      '/^(!{1,6})\\s?(.*)$/e',
      "'<:block><div class=\"someclass'.strlen('$1').PSS('\">$2</div>')");
    }

When you go to the sidebar's page it works, but the sidebar use <h1>'s
when you go to any other page.

Hagan




More information about the pmwiki-users mailing list