Lise - how to use tag field?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Lise - how to use tag field?

Post by frankmanl »

I set up LISE and want to use a field of type Tags.
I can enter any tag I like, but how to go on from here?
Actually I expected a tag cloud that displays all and any tags that are used, and clicking a tag getting a list of all items associated to that tag.
Or should the tag field be used in a different way?

Frank
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Lise - how to use tag field?

Post by Jo Morg »

Yeah , not all is well documented yet... lack of time...
{LISE<instancename> action=tagcloud} should do what you want. The templates used are from search group so template_search='templatename' should be used as a parameter. IIRC there is a sample template: TagCloud.
HTH
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Lise - how to use tag field?

Post by frankmanl »

Code: Select all

{LISEactueel action="tagcloud"}
results in a searchbox:
lise.jpg
lise.jpg (10.36 KiB) Viewed 2124 times
which, btw, does not react to terms I enter in it.
There is no sample template TagCloud.
If I can get this to work I'd be more than happy to write the missing documentation for the module.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Lise - how to use tag field?

Post by Jo Morg »

frankmanl wrote:There is no sample template TagCloud.
Apparently I forgot to include a sample template with the installation. Will add one to the next release.
Create a new search template:

Code: Select all

{$foo=ksort($tags)}
{foreach $tags as $k => $v}
 <a href="{$v}">{$k}</a>
{foreachelse}
{/foreach}
And call it like: {LISEactueel action=tagcloud template_search='templatename'} that should give you a good starting base.
frankmanl wrote:If I can get this to work I'd be more than happy to write the missing documentation for the module.
:)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Lise - how to use tag field?

Post by frankmanl »

This is a good start, Jo Morg.
Still got a couple of issues:

Code: Select all

Syntax error (...) on line 4 "{$foo=ksort($tags)}" PHP function 'ksort' not allowed by security setting
I solved this by using {$foo=sort($tags)}.

Tags are (I suppose) displayed by their position in the array: 0 1 2 3 etc., not alphabetically.
The tagword itself is not shown.
lise.jpg
lise.jpg (9.03 KiB) Viewed 2072 times
I've got a tagword EU and another nieuws. As you can see 'EU' is also part of nieuws.
Now when I click the link for tagword EU (on my testpage that would be link 0, all items of tag EU are returned, but also all items of tag nieuws.

I'll see if I can solve these items, but if you've got suggestions, please let me know.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Lise - how to use tag field?

Post by Jo Morg »

frankmanl wrote:I solved this by using {$foo=sort($tags)}.

Tags are (I suppose) displayed by their position in the array: 0 1 2 3 etc., not alphabetically.
Well, no. {$foo=sort($tags)} won't have the expected effect as $tags are naturally sorted by the order they are found when processing them. Quite the opposite: when using it on an associative array it "(...) assigns new keys to the elements in array. It will remove any existing keys that may have been assigned, rather than just reordering the keys*" and that's why you are getting that (odd) result.

Either remove {$foo=sort($tags)} completely, or replace it by the original {$foo=ksort($tags)} and add $config['permissive_smarty'] = 1; to the config.php file.
Note that this particular template was only tested on CMSMS 1.12, not on 2.0+, after I added the ksort to it.
I will probably add a parameter to the tag to do that in the action itself instead and remove the use the ksort on template on the next release.

* from PHP manual
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Lise - how to use tag field?

Post by frankmanl »

replace {$foo=sort($tags)} by the original {$foo=ksort($tags)} and add $config['permissive_smarty'] = 1; to the config.php file
Thanks a lot, this solved it all, the tags are alright now.

Frank
Locked

Return to “Modules/Add-Ons”