Page 1 of 1
ListitExtended, call from a link
Posted: Mon Dec 16, 2013 3:53 pm
by erpee
The following tag displays my category
But I want a way to create page where the category is loaded after a link has been clicked like:
Code: Select all
<a href="{ListIt2MyMod category="A2"}">Load Category A2</a>
This one doesn't work but it states nicely what I want.
Is there a way to realise this?
Re: ListitExtended, call from a link
Posted: Mon Dec 16, 2013 4:03 pm
by velden
Quick tip (I got from Stikki): have a look at the urls that are created when you enable pagination for that view/module.
Did not yet use it myself though. Still interested if you find another way.
Re: ListitExtended, call from a link
Posted: Mon Dec 16, 2013 4:48 pm
by calguy1000
Use CGSimpleSmarty
{module_action_link module='Listit2MyMod' category='a2' text='This is your link'}
Re: ListitExtended, call from a link
Posted: Mon Dec 16, 2013 5:06 pm
by erpee
Thanks Calguy, works like a charm!
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 3:47 pm
by erpee
calguy1000 wrote:Use CGSimpleSmarty
{module_action_link module='Listit2MyMod' category='a2' text='This is your link'}
Is there also a way to use an Image instead of "this is your link"?
e.g.
Code: Select all
{module_action_link module='Listit2MyMod' category='a2' image='uploads/image.png'}
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 3:51 pm
by velden
From the help:
{module_action_link}
A smarty plugin that can create a link to a module action.
Arguments:
module - The module to create a link to
action (default) - The action to call within the module
text - The text to put in the link
page - Specify the destination page
urlonly - Instead of generating a link, generate just the url
jsfriendly - Used with the urlonly parameter this parameter will ensure that a javascrpt friendly url is output.
confmessage - A confirmation message to display when the link is clicked.
image - An image to use on the link
imageonly - If an image is specified, create a link only consisting of the image. The text will be used for the title attribute
Any other arguments to the smarty plugin will be added to the URL generated.
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 4:18 pm
by erpee
Still not working. I've tried this:
Code: Select all
{module_action_link module='Listit2MyMod' category='a2' imageonly='uploads/image.png' text='This is your link'}
Am I doing something wrong?
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 4:24 pm
by velden
imageonly - If an image is specified
So use at least the 'image' parameter too.
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 5:00 pm
by erpee
I'm confused ... I can't get it to work ...
How should I edit the code?
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 6:28 pm
by velden
not sure but I guess:
Code: Select all
{module_action_link module='Listit2MyMod' category='a2' image='uploads/image.png' imageonly=1 text='This is your link'}
or alternative:
Code: Select all
<a href="{module_action_link module='Listit2MyMod' category='a2' urlonly=1 }"><img src="{uploads_url}/image.png" alt="" /></a>
ps. I prefer using {uploads_url} in stead of 'uploads'
Re: ListitExtended, call from a link
Posted: Tue Dec 17, 2013 7:16 pm
by erpee
velden wrote:
Code: Select all
<a href="{module_action_link module='Listit2MyMod' category='a2' urlonly=1 }"><img src="{uploads_url}/image.png" alt="" /></a>
ps. I prefer using {uploads_url} in stead of 'uploads'
This code did it for me ... Thanks
Re: ListitExtended, call from a link
Posted: Thu Apr 24, 2014 7:41 pm
by chandra
calguy1000 wrote:Use CGSimpleSmarty
{module_action_link module='Listit2MyMod' category='a2' text='This is your link'}
Made my day - thanx.
Cant find it in module help how to add module related parameters ...