Quantcast

Simple way to find page category

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Simple way to find page category

girlwithglasses
Hello all,

Is there a way to find out whether a page is in a category without doing an SMW query?

My situation is this: I have lots of pages with literature citations on them; these citations are generated automatically by retrieving data from external sources, and passed to the wiki in the

{{Citation|prop=val|prop=val| ... }}

format. That data is fed through a template for formatting and to create a subobject for each citation. I'd like to add an extra property to citations that appear in a certain category -- e.g. add something to the template like

{{#if: |{{#set:Has topic={{PAGENAME}}
}}

Is there a magic word or parser function or something that could do this?

One workaround would be to move all the category X pages into their own namespace, as that could easily be queried. I'm not sure I want to do that, though.

Any suggestions gratefully received!

Thanks,
Amelia.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Simple way to find page category

Ad Strack van Schijndel
Hi Amelia,
Something not clear to me. Do citations have a page of their own or are they in subobjects.
And where do you want to set the extra property? Usually that is in the same template where you assign the category, so you should have all information available to do what you want.

Kind regards,

Ad Strack van Schijndel

Wikibase Solutions
www.wikibase.nl
T: +31 162 229 686
M: +31 6 4023 2715

Op 30 okt. 2013, om 19:54 heeft girlwithglasses <[hidden email]> het volgende geschreven:

Hello all,

Is there a way to find out whether a page is in a category without doing an
SMW query?

My situation is this: I have lots of pages with literature citations on
them; these citations are generated automatically by retrieving data from
external sources, and passed to the wiki in the

{{Citation|prop=val|prop=val| ... }}

format. That data is fed through a template for formatting and to create a
subobject for each citation. I'd like to add an extra property to citations
that appear in a certain category -- e.g. add something to the template like

{{#if: |{{#set:Has topic={{PAGENAME}}
}}

Is there a magic word or parser function or something that could do this?

One workaround would be to move all the category X pages into their own
namespace, as that could easily be queried. I'm not sure I want to do that,
though.

Any suggestions gratefully received!

Thanks,
Amelia.



--
View this message in context: http://wikimedia.7.x6.nabble.com/Simple-way-to-find-page-category-tp5015920.html
Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Simple way to find page category

girlwithglasses
Hi Ad,

The citations are all subobjects, and I have a template that sets their
properties. It's the category of the page that the template gets
transcluded into that I want to be able to test (if possible).

Thanks,
Amelia.


On Thu, Oct 31, 2013 at 8:48 AM, Ad Strack van Schijndel <
[hidden email]> wrote:

> Hi Amelia,
> Something not clear to me. Do citations have a page of their own or are
> they in subobjects.
> And where do you want to set the extra property? Usually that is in the
> same template where you assign the category, so you should have all
> information available to do what you want.
>
> Kind regards,
>
> Ad Strack van Schijndel
>
> Wikibase Solutions
> www.wikibase.nl
> T: +31 162 229 686
> M: +31 6 4023 2715
>
> Op 30 okt. 2013, om 19:54 heeft girlwithglasses <[hidden email]>
> het volgende geschreven:
>
> Hello all,
>
> Is there a way to find out whether a page is in a category without doing an
> SMW query?
>
> My situation is this: I have lots of pages with literature citations on
> them; these citations are generated automatically by retrieving data from
> external sources, and passed to the wiki in the
>
> {{Citation|prop=val|prop=val| ... }}
>
> format. That data is fed through a template for formatting and to create a
> subobject for each citation. I'd like to add an extra property to citations
> that appear in a certain category -- e.g. add something to the template
> like
>
> {{#if: |{{#set:Has topic={{PAGENAME}}
> }}
>
> Is there a magic word or parser function or something that could do this?
>
> One workaround would be to move all the category X pages into their own
> namespace, as that could easily be queried. I'm not sure I want to do that,
> though.
>
> Any suggestions gratefully received!
>
> Thanks,
> Amelia.
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Simple-way-to-find-page-category-tp5015920.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>


--
Amelia Ireland
GMOD Community Support
http://gmod.org || @gmodproject
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Simple way to find page category

Argbert
Hi Amelia,

in case you just have a few categories to be considered, you can simply
query, whether the page belongs to one of them. E.g. if you have three
categories:

*This page belongs to category: {{#if: {{#ask: [[{{FULLPAGENAME}}]]
[[category:cat1]] }} | cat1 | }}{{#if: {{#ask: [[{{FULLPAGENAME}}]]
[[category:cat2]] }} | cat2 | }}{{#if: {{#ask: [[{{FULLPAGENAME}}]]
[[category:cat3]] }} | cat3 | }}

If you have much more categories to look for or you don't even know at all
which category is in the run, you could probably change the structure of
your templates to include a property like is_in_category.

Kind regards

Argi

-----Urspr√ľngliche Nachricht-----
Von: Amelia Ireland [mailto:[hidden email]]
Gesendet: Donnerstag, 31. Oktober 2013 19:18
An: SMW User mailinglist
Betreff: Re: [Semediawiki-user] Simple way to find page category

Hi Ad,

The citations are all subobjects, and I have a template that sets their
properties. It's the category of the page that the template gets transcluded
into that I want to be able to test (if possible).

Thanks,
Amelia.


On Thu, Oct 31, 2013 at 8:48 AM, Ad Strack van Schijndel <
[hidden email]> wrote:

> Hi Amelia,
> Something not clear to me. Do citations have a page of their own or
> are they in subobjects.
> And where do you want to set the extra property? Usually that is in
> the same template where you assign the category, so you should have
> all information available to do what you want.
>
> Kind regards,
>
> Ad Strack van Schijndel
>
> Wikibase Solutions
> www.wikibase.nl
> T: +31 162 229 686
> M: +31 6 4023 2715
>
> Op 30 okt. 2013, om 19:54 heeft girlwithglasses
> <[hidden email]> het volgende geschreven:
>
> Hello all,
>
> Is there a way to find out whether a page is in a category without
> doing an SMW query?
>
> My situation is this: I have lots of pages with literature citations
> on them; these citations are generated automatically by retrieving
> data from external sources, and passed to the wiki in the
>
> {{Citation|prop=val|prop=val| ... }}
>
> format. That data is fed through a template for formatting and to
> create a subobject for each citation. I'd like to add an extra
> property to citations that appear in a certain category -- e.g. add
> something to the template like
>
> {{#if: |{{#set:Has topic={{PAGENAME}}
> }}
>
> Is there a magic word or parser function or something that could do this?
>
> One workaround would be to move all the category X pages into their
> own namespace, as that could easily be queried. I'm not sure I want to
> do that, though.
>
> Any suggestions gratefully received!
>
> Thanks,
> Amelia.
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Simple-way-to-find-page-category-tp50
> 15920.html Sent from the Semantic Mediawiki - User mailing list
> archive at Nabble.com.
>
>
> ----------------------------------------------------------------------
> -------- Android is increasing in popularity, but the open development
> platform that developers love is also attractive to malware creators.
> Download this white paper to learn more about secure code signing
> practices that can help keep Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.c
> lktrk _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>


--
Amelia Ireland
GMOD Community Support
http://gmod.org || @gmodproject
----------------------------------------------------------------------------
--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...