Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to remove slash in section url?
Reading the oficial Textpattern blog I have noticed that section urls do not have slash (/) at the end.
Usually when using <txp:section /> tag, section url always ends with /
How was this achieved?
https://textpattern.com/weblog
Instead of
https://textpattern.com/weblog/
Thanx.
Offline
Re: How to remove slash in section url?
The sections are hard coded in that site, not dynamically generated. It saves database queries and render time. The way I work on templates, I tend to only makes things dynamically generated if it really needs to be, otherwise I hard code it into the html.
Offline
Re: How to remove slash in section url?
As a sidenote – TXP 4.6 adds the the closing /
to some tags but not all. TXP 4.7 (under development) will be more consistent and never use that closing /
.
That is the case for the <txp:section />
tag for example.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: How to remove slash in section url?
phiw13 wrote #306749:
As a sidenote – TXP 4.6 adds the the closing
/
to some tags but not all. TXP 4.7 (under development) will be more consistent and never use that closing/
.That is the case for the
<txp:section />
tag for example.
H Philippe,
I would disagree with that:)
The way I use sections is more like directories so the trailing slash is very important and semantically correct.
the way static sites work makes sense to me
- Home
- /section/
- /section/article 1
- /section/article 2
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to remove slash in section url?
colak wrote #306750:
I would disagree with that:)
it is not me who made that change… (and I’m not entirely happy with it, FWIW). I do eventually see the logic in that TXP 4.6 would output different things depending on which tag you use. TXP 4.7 is more consistent.
And FWIW, i am slowly going through various sites I made and check the URLs – in some cases I have the build the URL more manually to keep things as they were.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: How to remove slash in section url?
colak wrote #306750:
H Philippe,
I would disagree with that:)
The way I use sections is more like directories so the trailing slash is very important and semantically correct.
the way static sites work makes sense to me
- Home
- /section/
- /section/article 1
- /section/article 2
If I use url like site.com/title, I d’ like to have all urls without slash to be consistent.
This scheme
site.com/section/
site.com/title
Looks a little confusing. Not important for SEO though.
Last edited by zenman (2017-08-29 07:08:19)
Offline
Re: How to remove slash in section url?
zenman wrote #306752:
If I use url like site.com/title, I d’ like to have all urls without slash to be consistent.
This scheme
site.com/section/
site.com/titleLooks a little confusing. Not important for SEO though.
this is true but unless you have specific reasons, you could work without using sections as the override form function could be used to manipulate the layout of the page anyway. Although I do not believe that we should be slaves to SEO, I do believe that urls have semantic significance for the seasoned surfer.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to remove slash in section url?
I want to strictly follow this semantic standard, too. And would like to know, is there some native method in Textpattern, preventing Google to access section without ending slash in URL?
Offline
Re: How to remove slash in section url?
Yes, use link canonical in your page <head>
to tell search engines which pattern of URL should be indexed:
<link rel=canonical href="https://example.com/example-section">
Offline
Re: How to remove slash in section url?
phiw13 wrote #306751:
it is not me who made that change… (and I’m not entirely happy with it, FWIW). I do eventually see the logic in that TXP 4.6 would output different things depending on which tag you use. TXP 4.7 is more consistent.
And FWIW, i am slowly going through various sites I made and check the URLs – in some cases I have the build the URL more manually to keep things as they were.
It was me (here), but I don’t have an established opinion re the trailing slash. The main potential issue for me is that
child
URL relative to/base/
is/base/child
child
relative to/base
is (perhaps surprisingly)/child
This could break pre-4.7 hard-coded relative URLs, but it’s yet time to revert back to 4.6-style links.
Offline
Re: How to remove slash in section url?
Brief aside but this thread is giving me acid flashbacks. Personally, I have never liked trailing slashes for individual urls.
This seems to be Google’s official stance.
This is the most recent article I found.
Offline
Re: How to remove slash in section url?
This could break pre-4.7 hard-coded relative URLs, but it’s yet time to revert back to 4.6-style links.
I hope not. Our main site depends on the trailing slash on the section url
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline