Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi,
This is my first time posting. First of all, great job with the CMS! Very easy to learn and use.

I am working on a project that requires me to list some work items (already implemented with cms_repeatable) and each of these items has a link to a demo page (demo.php, clonable='1').

Here is what I want to do next (and where I'm facing some difficulties):

- After clicking one of the items on the home page, you are sent to the /demo.php?p=N
Q: How do I link the item on the home page to point to its demo page?

- Once on /demo.php, I want to include a header that displays the item's download count and a download button pointing to this page's files.
Q: How do I get the variables I need and make them available in this page for this specific item?

Any help would be much appreciated.
Thanks.
Hi :)

I'll assume the items listed on the home pages come from the repeatable_regions, right?
So the issue now is how to link each item with a particular demo page.

The easiest way would be to define a 'text' region within the repeatable_region so as to make the input appear on each row. Ask the user to copy and paste the demo pages' URL into this region On the frontend, use its value to create the link.

Another, slightly more involved, method would be to show a dropdown (instead of text) listing all the demo pages. The user would now only need to select the page to be linked.

To populate this dropdown with the demo pages, please use the 'dynamic' parameter as explained here -
viewtopic.php?f=4&t=1671&p=2483#p2483

Coming to the second part of your query -
I am sorry but I could not understand what you meant by the 'download count' and the files
item's download count and a download button pointing to this page's files.

Could you please clarify?
Hi KK, thanks for your reply!

Yes, I'm using repeatable regions for the items. I guess having the user paste the link manually is a bit more practical, so I'm going to do it that way.

The second issue is just a way for me to keep track of (or even show it on the Frontend) how many times a certain item has been downloaded. I looked up some info about 'db_persist' but there is very few. I think what I need to do is assign this number to an editable region and every time the download page is visited, it will increment by 1. The problem is that I don't know how to make that value persistent because if I increment it and refresh the page, normally the value is reset to 1.

Thank you for your help.
Perhaps the following would be helpful -
viewtopic.php?f=8&t=8913#p18532

Do let us know if something is unclear.
Awesome! :D Works now.

Thank you
5 posts Page 1 of 1
cron