another minor patch

Skinning and designing Serendipity (CSS, HTML, Smarty)
Anson
Regular
Posts: 24
Joined: Thu Apr 16, 2009 7:05 am

another minor patch

Post by Anson »

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.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled »

Anson wrote:I'm mentioning it here because it seems the Bulletproof site is not being actively updated.
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 something :)

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

Actually, instead of this:

Code: Select all

<li lang="en"><a href="{$serendipityBaseURL}index.php?/archive">Skip to archive page</a></li>
I believe this is ultimately the best:

Code: Select all

<li lang="en"><a href="{$serendipityBaseURL}{$serendipityRewritePrefix}archive">Skip to archive page</a></li>
the path for "archive" is a configuration item, but I do not see a smarty variable that contains it, or that could change too.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled »

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.
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 ... :?

Garvin? Anyone?

YL
Anson
Regular
Posts: 24
Joined: Thu Apr 16, 2009 7:05 am

Re: another minor patch

Post by Anson »

Don Chambers wrote:

Code: Select all

<li lang="en"><a href="{$serendipityBaseURL}{$serendipityRewritePrefix}archive">Skip to archive page</a></li>
Cool, thanks!
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

yellowled wrote:
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.
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 ... :?

Garvin? Anyone?

YL
Yup - tested. That works just fine with, or without, URL rewriting...
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

Committed to svn trunk.
=Don=
Anson
Regular
Posts: 24
Joined: Thu Apr 16, 2009 7:05 am

Re: another minor patch

Post by Anson »

Don Chambers wrote:Committed to svn trunk.
Neat, I've applied it here and it works a treat. :)
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

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)

Image

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=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: another minor patch

Post by Timbalu »

IMHO it is just wrong labeled in english, it is much clearer in german:

Code: Select all

Pfad zu den Einträgen
Pfad zu den Archiven
(better: Pfad zum Archiv)

should be in < en >

Code: Select all

Path to the entries
Path to the archives
(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.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

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?
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: another minor patch

Post by Timbalu »

Don Chambers wrote:There is also the Permalink Entry URL structure, which defaults to archives/%id%-%title%.html.
This is what I meant. This is an entry related link /archives/ID-whatever.html.

What about {$CONST.PATH_ARCHIVE}?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled »

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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers »

Timbalu wrote:What about {$CONST.PATH_ARCHIVE}?
This is merely the word "archive".
Yellowled wrote:* the actual link to the archive page is /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:* /archives/ is meant to be a prefix for single entries (I don't know why we even need that)
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)
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled »

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.
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: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)
Right, I forgot about that.

YL
Post Reply