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 » Thu Apr 23, 2009 1:39 am

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.

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled » Thu Apr 23, 2009 10:49 am

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Thu Apr 23, 2009 3:19 pm

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.

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled » Thu Apr 23, 2009 3:31 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

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

Re: another minor patch

Post by Anson » Thu Apr 23, 2009 3:33 pm

Don Chambers wrote:

Code: Select all

<li lang="en"><a href="{$serendipityBaseURL}{$serendipityRewritePrefix}archive">Skip to archive page</a></li>

Cool, thanks!

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Thu Apr 23, 2009 3:49 pm

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

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Thu Apr 23, 2009 4:08 pm

Committed to svn trunk.

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

Re: another minor patch

Post by Anson » Fri Apr 24, 2009 3:29 am

Don Chambers wrote:Committed to svn trunk.

Neat, I've applied it here and it works a treat. :)

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Sat Feb 07, 2015 8:35 pm

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

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: another minor patch

Post by Timbalu » Sun Feb 08, 2015 10:41 am

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

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Sun Feb 08, 2015 5:29 pm

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?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: another minor patch

Post by Timbalu » Sun Feb 08, 2015 5:36 pm

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

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled » Sun Feb 08, 2015 6:49 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: another minor patch

Post by Don Chambers » Sun Feb 08, 2015 7:18 pm

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)

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: another minor patch

Post by yellowled » Sun Feb 08, 2015 7:41 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Post Reply