Форумы / Cotonti / Extensions / Random page link on index

musashi9
#1 12.02.2017 12:25

Is there a plugin that shows a random page from the database with a link to it on the index page.

I have over 1000 pages on my site and a nice little random link generator will work wonders.

 

Kort
#2 12.02.2017 20:53

Pagelist Plugin

Use it like:

{PHP|pagelist('pagelist.sometpl','1','RAND()')}

... or add parameters to suit your needs

SED.by - создание сайтов, разработка плагинов и тем для Котонти
musashi9
#3 13.02.2017 00:18

Ah good stuff, can someone help me config it for my needs?

I would like to show 5 random links from only 2 categories (I dont need pages from ...news,general, ect...)

Is it also possible to only show the page ID name not all the folders before it (instead of General news > page-id=1) Just show page-id=1

Thanks

Kort
#4 14.02.2017 10:22

Callback in the template:

{PHP|pagelist('pagelist.random','5','RAND()', '', '', '', 'cat1;cat2')}

Simple template (pagelist.random.tpl):

<!-- BEGIN: MAIN -->
<!-- BEGIN: PAGE_ROW -->
	{PAGE_ROW_ID}
<!-- END: PAGE_ROW -->
<!-- END: MAIN -->

 

SED.by - создание сайтов, разработка плагинов и тем для Котонти
musashi9
#5 14.02.2017 14:44

Amazing thanks. How do I get it to show  the 5 in a table/rows

Kort
#6 20.02.2017 17:02

Easy:

<!-- BEGIN: MAIN -->
<table>
  <tbody>
<!-- BEGIN: PAGE_ROW -->
    <tr><td>{PAGE_ROW_ID}</td></tr>
<!-- END: PAGE_ROW -->
  </tbody>
</table>
<!-- END: MAIN -->

 

SED.by - создание сайтов, разработка плагинов и тем для Котонти