Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello, I need a solution:

I'm doing a project that I need to include a button and when I click, load a blog news randomly.

Can someone help?
Every time the following code gets executed, it should fetch a random page out of the 'blog.php' template -
Code: Select all
<cms:pages masterpage='blog.php' orderby='random' limit='1'>
    .. a random page here everytime this webpage is accessed ..
</cms:pages>

You can adapt it to your particular use-case.

Hope the reply helps :)
KK wrote: Every time the following code gets executed, it should fetch a random page out of the 'blog.php' template -
Code: Select all
<cms:pages masterpage='blog.php' orderby='random' limit='1'>
    .. a random page here everytime this webpage is accessed ..
</cms:pages>

You can adapt it to your particular use-case.

Hope the reply helps :)



Thanks very much, that's right, I just need to adjust this so that a button runs that page
Hi, @konnox. In my view the task can be handled by placing your button as a cms:input in a cms:form.
The logic becomes as follows: the button is clicked -> form submits successfully, so k_success variable becomes available -> it is where you can place cms:redirect inside the code @KK provided.
4 posts Page 1 of 1
cron