another minor patch
another minor patch
One-liner: replace 'index.php' with '{$serendipityIndexFile}' on line 71 of templates/bulletproof/index.tpl
This is in the "skiplinks" div used to show navigation options in text-based browsers. For me it makes for cleaner links - my IndexFile is set to '' - but it also helps anyone who has changed their IndexFile setting.
I'm mentioning it here because it seems the Bulletproof site is not being actively updated. I'm not uploading a diff because the board identified my patch as a possible attack vector. Whoa.
This is in the "skiplinks" div used to show navigation options in text-based browsers. For me it makes for cleaner links - my IndexFile is set to '' - but it also helps anyone who has changed their IndexFile setting.
I'm mentioning it here because it seems the Bulletproof site is not being actively updated. I'm not uploading a diff because the board identified my patch as a possible attack vector. Whoa.
Re: another minor patch
That's just because it doesn't have to be updated frequently. BP is pretty solid these days, we simply see no need to post there just for the sake of posting somethingAnson wrote:I'm mentioning it here because it seems the Bulletproof site is not being actively updated.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
Actually, instead of this:
I believe this is ultimately the best:
the path for "archive" is a configuration item, but I do not see a smarty variable that contains it, or that could change too.
Code: Select all
<li lang="en"><a href="{$serendipityBaseURL}index.php?/archive">Skip to archive page</a></li>
Code: Select all
<li lang="en"><a href="{$serendipityBaseURL}{$serendipityRewritePrefix}archive">Skip to archive page</a></li>
=Don=
Re: another minor patch
Actually, I just accidentally stumbled across {$serendipityArchiveURL} in staticpage-entries-listing.tpl. But I don't know if that is exclusive to the static pages plugin or a global variable ...Don Chambers wrote:the path for "archive" is a configuration item, but I do not see a smarty variable that contains it, or that could change too.
Garvin? Anyone?
YL
Re: another minor patch
Cool, thanks!Don Chambers wrote:Code: Select all
<li lang="en"><a href="{$serendipityBaseURL}{$serendipityRewritePrefix}archive">Skip to archive page</a></li>
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
Yup - tested. That works just fine with, or without, URL rewriting...yellowled wrote:Actually, I just accidentally stumbled across {$serendipityArchiveURL} in staticpage-entries-listing.tpl. But I don't know if that is exclusive to the static pages plugin or a global variable ...Don Chambers wrote:the path for "archive" is a configuration item, but I do not see a smarty variable that contains it, or that could change too.
Garvin? Anyone?
YL
=Don=
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
Neat, I've applied it here and it works a treat.Don Chambers wrote:Committed to svn trunk.
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
I'm going to bump this post from several years ago because I am running into this again.
I want to provide a link to a site's archive from within a theme, just as was discussed in this thread. YL discovered {$serendipityArchiveURL}, and that was incorporated into bulletproof's skiplinks.
In a standard configuration of s9y, there is a path to archives ("archive") and a path to archive ("archive").
{$serendipityArchiveURL} is actually the first one ("archives" - plural). Technically, a blog's archive is example.com/archive (singular)
1. When left at the default value of "archives", if I navigate to the archive via {$serendipityArchiveURL} I get there, but the displayed URL is example.com/archives/?url=/archive, which is not as clean as example.com/archive.
2. If I change the default value to something else, say "cheeseburgers", {$serendipityArchiveURL} becomes to example.com/cheeseburgers, which leads to a 404.
3. If I change the first back to archives, then change the default value of archive (singular) to hamburger, I get my archive page - as expected - at example.com/hamburger. However, if I try to navigate via {$serendipityArchiveURL} I again land at example.com/archives/?url=/archive, but now I also get a 404 because the path is hardcoded to url=/archive.
So, there seems to be one or two things to clean up here in the code.. and I will leave that to those more skilled than I. But what I want to know, is there a variable I can use in a template that leads me to example.com/archive (singular) - or whatever "archive" might be changed to via configuration??
I want to provide a link to a site's archive from within a theme, just as was discussed in this thread. YL discovered {$serendipityArchiveURL}, and that was incorporated into bulletproof's skiplinks.
In a standard configuration of s9y, there is a path to archives ("archive") and a path to archive ("archive").
{$serendipityArchiveURL} is actually the first one ("archives" - plural). Technically, a blog's archive is example.com/archive (singular)
1. When left at the default value of "archives", if I navigate to the archive via {$serendipityArchiveURL} I get there, but the displayed URL is example.com/archives/?url=/archive, which is not as clean as example.com/archive.
2. If I change the default value to something else, say "cheeseburgers", {$serendipityArchiveURL} becomes to example.com/cheeseburgers, which leads to a 404.
3. If I change the first back to archives, then change the default value of archive (singular) to hamburger, I get my archive page - as expected - at example.com/hamburger. However, if I try to navigate via {$serendipityArchiveURL} I again land at example.com/archives/?url=/archive, but now I also get a 404 because the path is hardcoded to url=/archive.
So, there seems to be one or two things to clean up here in the code.. and I will leave that to those more skilled than I. But what I want to know, is there a variable I can use in a template that leads me to example.com/archive (singular) - or whatever "archive" might be changed to via configuration??
=Don=
Re: another minor patch
IMHO it is just wrong labeled in english, it is much clearer in german:
(better: Pfad zum Archiv)
should be in < en >(Yay, better "archive" (singular))
So every entry related link links to archives, the other just for one single case: to the archive.
The var is also in $serendipity['permalinkArchivePath'] or PATH_ARCHIVE constant.
Code: Select all
Pfad zu den Einträgen
Pfad zu den Archiven
should be in < en >
Code: Select all
Path to the entries
Path to the archives
So every entry related link links to archives, the other just for one single case: to the archive.
The var is also in $serendipity['permalinkArchivePath'] or PATH_ARCHIVE constant.
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
Not sure I am understanding you Ian. There is also the Permalink Entry URL structure, which defaults to archives/%id%-%title%.html.
Besides the errors I encountered in my post above, what I need is a smarty var for the archive path. Does one exist?
Besides the errors I encountered in my post above, what I need is a smarty var for the archive path. Does one exist?
=Don=
Re: another minor patch
This is what I meant. This is an entry related link /archives/ID-whatever.html.Don Chambers wrote:There is also the Permalink Entry URL structure, which defaults to archives/%id%-%title%.html.
What about {$CONST.PATH_ARCHIVE}?
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: another minor patch
As far as I understand it
* the actual link to the archive page is /archive/
* /archives/ is meant to be a prefix for single entries (I don't know why we even need that)
* /archives/ without an entry URL added to it redirects to /archive/, probably because it is a common typo
The confusing thing about this is that /archives/ and /archives have the same redirect behaviour, but the latter will change the URL in the browsers address bar to /archives/?url=/archive.
YL
* the actual link to the archive page is /archive/
* /archives/ is meant to be a prefix for single entries (I don't know why we even need that)
* /archives/ without an entry URL added to it redirects to /archive/, probably because it is a common typo
The confusing thing about this is that /archives/ and /archives have the same redirect behaviour, but the latter will change the URL in the browsers address bar to /archives/?url=/archive.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: another minor patch
This is merely the word "archive".Timbalu wrote:What about {$CONST.PATH_ARCHIVE}?
The path can change in s9y configuration, which is why I need a smarty variable... I cannot depend on it always being "archive", even if no one has ever changed the default.Yellowled wrote:* the actual link to the archive page is /archive/
I don't think that is it. Single entries are formatted using the Permalink Entry URL structure, as I mentioned above. /archives/ (plural) is the path to specific archives, such as all entries for specific month (example.com/archives/2015/02.html) or topics for a specific month (example.com/archives/2015/02/summary.html)Yellowled wrote:* /archives/ is meant to be a prefix for single entries (I don't know why we even need that)
=Don=
Re: another minor patch
I know. What I don't know if there is one. However, you should somehow be able to retrieve the value you need from the configuration. I just don't know how, because, you know, PHP is voodoo. If it is possible, it will probably require some kind of config.inc.php function.Don Chambers wrote:The path can change in s9y configuration, which is why I need a smarty variable... I cannot depend on it always being "archive", even if no one has ever changed the default.
Right, I forgot about that.Don Chambers wrote:I don't think that is it. Single entries are formatted using the Permalink Entry URL structure, as I mentioned above. /archives/ (plural) is the path to specific archives, such as all entries for specific month (example.com/archives/2015/02.html) or topics for a specific month (example.com/archives/2015/02/summary.html)
YL