Re: Base path for categories
will guaraldi <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
I think you're going to have to build a plugin. I don't think the
category is available outside of the entry.
You should look at the data dict in the request object. Check to see if
the bl_type is file or dir.
If bl_type is file, then peel off the last thing from pi_bl. If it's dir,
then use pi_bl as it is. If the bl_type is an empty string, then it's
either a 404, or a different plugin is building the entries and it's not
based on the blog datadir.
So something like this:
%<------------------
import os.path
def cb_prepare(args):
req = args["request"]
data = req.getData()
bl_type = data.get("bl_type", "")
pi_bl = data.get("pi_bl", "")
if bl_type == "dir":
data["category"] = pi_bl
elif bl_type == "file":
data["category"] = os.path.split(pi_bl)[0]
else:
data["category"] = ""
%<------------------
Or something to that extent. I think that'd work, but haven't tested it
(and this is assuming I understand what you're asking for in the first
place).
So then the variable you'd want to use in your head and foot templates
would be $category.
Hope that helps--
/will
On Tue, 21 Sep 2004, Steven Cummings wrote:
> Hello all,
>
> I'm fairly new to pyblosxom, and I'm jumping right in to try to get
> some templates working. I've got rss and atom flavors working, and
> what I want to do is provide links for them on each category page.
> Unfortunately, the $path variable only exists per entry, so it seems I
> can only link to the weblog-base directory (and hence only the base
> rss and atom files) no matter what category is currently be viewed.
> Did I miss something, or is a further plugin required to achieve this.
> Thanks.
>
> /S
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php