Space in H1 when the title is personalized

Allgemeines
Doc
Posts: 38
Joined: Fri 25. Dec 2015, 09:20

Space in H1 when the title is personalized

Post by Doc »

Hello

When we have chosen a personalized title instead of the menu link, we get a space in the code between the <h1> tag and the beginning of the title.
<h1>MyTitle</h1>
<h1>spaceMyCustomTitle</h1>
Do you know why ?

Daniel.
Gert
Posts: 2065
Joined: Sun 18. Nov 2012, 14:18

Re: Space in H1 when the title is personalized

Post by Gert »

Hello,

sorry - I do not understand what you mean.

Have you a link for me?

Gert

=================================

PS: Do you mean an alternative page heading? That I can reproduce ... will have a look tomorrow.
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Gert
Posts: 2065
Joined: Sun 18. Nov 2012, 14:18

Re: Space in H1 when the title is personalized

Post by Gert »

Hello Daniel,

I have found it, will be fixed in the next version.

It is a very ancient bug in the page_params plugin, nobody has noticed it, since more than 10 years :mrgreen: - you can fix it by yourself, because there will not be a new CMSimple version next days.

Open ./plugins/page_params/index.php, search for "\\1 " and remove the space behind the 1 (two times), and the problem is gone,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Doc
Posts: 38
Joined: Fri 25. Dec 2015, 09:20

Re: Space in H1 when the title is personalized

Post by Doc »

Hello
I myself only noticed it recently. It has no influence on SEO. But for a clean code ...
Thanks, Daniel
jack31
Posts: 41
Joined: Fri 19. Feb 2021, 20:54
Location: France

Re: Space in H1 when the title is personalized

Post by jack31 »

Hello,

Is there a disadvantage in settings.CMS/Uri separator to replace "__" by "-" ?

Moreover, why this choice in URL's of "__" and not "-" as we usually see ?
Gert
Posts: 2065
Joined: Sun 18. Nov 2012, 14:18

Re: Space in H1 when the title is personalized

Post by Gert »

jack31 wrote: Tue 23. Feb 2021, 17:02 Is there a disadvantage in settings.CMS/Uri separator to replace "__" by "-" ?
I would not do so, because "-" is an often used character in page names,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
jack31
Posts: 41
Joined: Fri 19. Feb 2021, 20:54
Location: France

Re: Space in H1 when the title is personalized

Post by jack31 »

Sorry, I love "-" ! :mrgreen:
If I fill in "_", is it OK ?
Gert
Posts: 2065
Joined: Sun 18. Nov 2012, 14:18

Re: Space in H1 when the title is personalized

Post by Gert »

jack31 wrote: Tue 23. Feb 2021, 18:18 If I fill in "_", is it OK ?
Try it - but do not wonder about the results :mrgreen:

I will not make test series with that.
jack31 wrote: Tue 23. Feb 2021, 18:18 Sorry, I love "-" ! :mrgreen:
Why you do not try "---" :?:

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
jack31
Posts: 41
Joined: Fri 19. Feb 2021, 20:54
Location: France

Re: Space in H1 when the title is personalized

Post by jack31 »

Because I didn't know it existed ;)

Well, it's prettier that way.
Doc
Posts: 38
Joined: Fri 25. Dec 2015, 09:20

Re: Space in H1 when the title is personalized

Post by Doc »

Hello
Originally, it seems like it was for Facebook who didn't like the ":" as a separator. I use the "-" without worry.
If we use some of the 2021 Templates, we must remember to change in the template file /templatefuncs/scripts/slimmenu.php

Code: Select all

$t.='<a href="?' . str_replace($cf['uri']['seperator'] . uenc($h[$ta[$i]]),'___',$u[$ta[$i]]) . '' . uenc(str_replace(' ','_',$slimmenuUriArray[$ta[$i]])) . '">';
by

Code: Select all

$t.='<a href="?' . str_replace($cf['uri']['seperator'] . uenc($h[$ta[$i]]),$cf['uri']['seperator'],$u[$ta[$i]]) . '' . str_replace(' ',$cf['uri']['seperator'],$slimmenuUriArray[$ta[$i]]) . '">';
Post Reply