Re: [Tiki-users] How to get category name by its id

Jonny Bradley via TikiWiki-users <[email protected]>
Newsgroups gmane.comp.cms.tiki.user
Message-ID <[email protected]>
Hi Ilya

Yes, there a catch using plugin list to find categories - by default categories aren't "searchable" but they are indexed, so there's an ugly parameter searchable_only on plugin list to allow you to do that, like this:

{LIST(searchable_only="0")}
  {filter type="category"}
  {filter field="object_id" exact="4"}
  {OUTPUT()}{display name="title"}{OUTPUT}
{LIST}

Not totally sure why it's like this, it just is! :)

jonny




> On 7 Mar 2021, at 07:38, Ilya Perminov <[email protected]> wrote:
> 
> Hi,
> 
> What's the best way of showing the name of a category with a given Id?
> {category id="4" sub="n" showlinks="n" categoryshowlink="n"
> maxRecords="0" showTitle="y"}
> works, but feels hackish and includes hard coded word "category" to the output.
> {LIST(cache="y")}
>  {output template="debug"}
>  {filter field="object_id" exact="4"}
> {LIST}
> returns no results, so it looks like categories do not get into the
> unified index. Do I need to enable something?
> 
> Thanks,
> Ilya
> 
> 
> _______________________________________________
> TikiWiki-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.