Copy link to clipboard
Copied
Like blog posts, we can also list categories on a page and use them to display the web app items from a web app based on the particular category selected:
Working example:
test
You can go to above link and then click on any link, it will take you to another page and display the web app items based on the category link selected.
To create such setup:
1) First, note down each category name and its category ID by going to site settings > categories > select a category: http://prntscr.com/ck6y9s
2) Go to the page where you want to list all the categories link and create the link as per following code:
<a href="/asjontest.html?link=118562">Australia</a><br/>
<a href="/asjontest.html?link=142187">BOYS</a>
Here we have destination page URL along with a variable named link which points to category ID of particular category. Save the page after creating the links.
3) Go to the destination page, and put the following module:
{module_webapps id="27004" filter="classified" itemId="{module_url,link}" resultsPerPage="10" hideEmptyMessage="false" rowCount="" sortType="ALPHABETICAL" collection="my_custom_collection_name"}
Here remember to replace the id = "27004" with your web apps ID. Save the page.
Now you can go and check the setup. It should work.
Hope this helps.
Regards,
Gaurav Aggarwal
Copy link to clipboard
Copied
Hi Gaurav,
Who is this directed too?
You manually say to right down category id's here - You do not need to do this. You can use module_data to get the categories and use those to pass the parameter through the URL.
You do not need module_url in this case with liquid you can save a module by using globals.get.link
Through the above you form an automated list of links with id's and a cleaner page module with results.
Copy link to clipboard
Copied
Hi Liam,
are you able to post an example of code of this?
what I have done at the moment is create a page which uses the page?categoryid to then link to another page that contains the web app items for that category.
if there was a way to display the web apps category on a page and then view the items for that category it would be really helpful, as I woundnt need to create a separate page for every category.
Copy link to clipboard
Copied
Just curious: is {{globals.get.link}} a thing? I wasn't aware that it existed.
Copy link to clipboard
Copied
mywebsite.com/mypage?athing=something
globals.get.athing
Any parameter in the URL will be in the globals.get
Copy link to clipboard
Copied
Understood. Thanks Liam!