[ZPT] Creating Links to Other Folders : A Fun Problem For Ages 9-99!
Edward Pollard
pollej@uleth.ca
Fri, 25 Oct 2002 09:45:01 -0600
So, I am a novice Zoper, with great aspirations for solving all the
worlds problems.
I'm building a web product for the management of our website. However,
one particularily advanced portion of my problem is eluding my
underdevloped Zope skills in finding a solution. I thought I'd share,
and we can see what we all come up with.
I'm using properties on page templates and folders to indicate if an
object should be part of our menuing structure. You can stick stuff all
over the place, but until you add the 'isRanked' property, it doesn't
show up automatically linked to the website. We structure the content
using a heirarchy of folders. Its very nice and I'm quite happy with it.
It allows us to have dynamic content, but lets us stick static stuff in
as well should we need to. I have a pretty good grip on all the tools
for editing/managing that I'll need to build to make it work.
The problem is basically surmised as such: distinct folder all across
the website have a relationship to one another, how can I express this?
Consider a folder called "Policies" - every department and subdepartment
is going to have one. We'd like all the policies from the subdepartments
to appear in the department policy folder. That is, the script that
generates the list of documents for the department policy folder, needs
to be able to find specific other folders all across the website, and
analyse those folders content.
Is this clear? I sure hope so. I wanted to give some backstory so my
problem made some sense. But I could probably simplify it it "I want to
be able to create a link in a folder, to some other folder, which makes
it seem as if the contents of the linked folder are in the original
folder". Oh, wait. Thats not much clearer.
I had a similar problem with a need to link to disparate documents all
across the website, regardless of the generated hierarchy. I solved this
problem by creating, and then looking for, a property called "hasURL".
If a document has this property, its contents are ignored, and all
references to that object get redirected to the URL found in the
contents of said property. (its more than that, involving special
scripts to define roots of local references, but I'll leave it there for
now)
So I'm thinking of a similar solution for this problem. I've started my
solution by creating a folder, adding a property "vLink" with a locally
referenced path to another folder, eg "../../otherdepartment/policy". My
scripting is savvy enough to be able to get this string, but I just
don't know how to make Zope go over to the folder specified in the
string, and take a look inside it.
Either I'm very close, with just a gentle push needed, or I'm REALLY far
off, and someone needs to club me in the head with a big stick.
So, any wisdom to share with this humble suplicant?
I appreciate your time,
Edward