I feel like a fool and know I am missing or have forgotten something obvious but please humor me. I can't figure out how to query the current page for a property value. My main goal is to do what Yaron suggests and set each Category-A page's catc property from its catb's catc property. My best (utterly failed) attempt is:
{{#set: catc={{#show:{{#show: {{SUBJECTPAGENAME}} | ?catb}} | ?catc}}}}
Since {{#show: {{SUBJECTPAGENAME}} | ?catb}} just by itself is not working (shows nothing, no error), I must be way off track. I apologize for my ineptitude but I don't see anything like what I'm trying to do in the docs, probably because its obvious and doesn't need explaining.

Yaron Koren [7/27/2009 12:51 AM] wrote:
Unfortunately, there's no simple way to do this; the problem is that SMW's #ask queries don't allow for display of sub-properties. In other words, let's say A, B and C represent "City", "State" and "Country", respectively. What you want is something like:

{{#ask:[[Category::City]]|format=outline|? Has state|? Has state.Has Country|outlineproperties=Has state, Has state.Has country}}

...or, in other words,

{{#ask:[[Category::A]]|format=outline|? catb|? catb.catc|outlineproperties=catb, catb.catc}}

Unfortunately, though SMW lets you query on "Has state.Has country", it doesn't let you display it - which I think would be a great feature to have, especially for the "outline" format. Instead, you'll have to, in a sense, do it manually, by adding a "Has country" property directly to each "city" page, which would have to be done through a query. It's a bit of a mess, though much less so if you store "cities" using templates - that way you only need to add the awkward query once.


On Mon, Jul 27, 2009 at 12:02 AM, Scott Reed <sreed@avacoda.com> wrote:
Say I have a hierarchical page structure:
Category-A pages have a property, catb, with Category-B page values
Category-B pages have a property, catc, with Category-C page values
I want an outline with the following structure
Category-C page 1
  Category-B pages with catc=(Category-C page 1)
    Category-A pages with catb=(Category-B pages with catc=Category-C page 1)
Category-C page 2
I have two-level category hierarchy outlines working fine but I don't understand this technology well enough to figure it out for more than two-levels. Any assistance would be much appreciated.


Semediawiki-user mailing list