-
- 139 Posts
I’m using the RandomHTML snippet to fetch html chunks from the filesystem on folder assets/randomhtml . I would like to know if it is possible to have a directory where in each page you create, it exports the HTML code of the ’content’ field to a specific folder on the filesystem.
For example
- There is a Folder ’Promotions’
- In that folder, if you create a document with title ’promotion-one’, on saving the document the html code for the ’content’ field gets exported to a file called ’promotion-one.html’
- As a result, the RandomHTML snippet will display a random HTML page from that directory.
This would provide an easy way for content managers to add their own promotions, banners, teasers, etc...
-
- 741 Posts
I think you want to random show one of the documents when you load a certain page on the site?
You could use Ditto to randomly select 1 document from the folder ’Promotions’ and then make a snippet that redirects you to the right page. So you call this snippet from the ditto template and give the id of the document to the snippet so that it can do it’s work.
with regards,
Ronald Lokers
'Front-end developer' @
h2o Media
-
- 741 Posts
Then you could use ditto and use a black document template, but your content editors have to past the complete template they want into the content area.
with regards,
Ronald Lokers
'Front-end developer' @
h2o Media