Tiny News Feed
News List
Home Page
News List
Search
Editing
Edit This News
Please correct the information in the form below in order to edit this page on your website.
Page URL:
http://mimimi.software/demos/TinyNewsFeed/news/
Leave this field blank if you want to automatically generate the page URL. In this case, it will consist of a random set of characters.
Visible For All
Title:
This field contains the name of the publication in listings. It is also the string of the page Title tag.
Short Text:
In this example, we will read the list of latest publications and put it into the variable $TEST. We will then iterate through this list to print its sublists.
This field contains short introductory text that appears in publication listings and at the top of the publication page. It is also the string of the page Meta Description tag.
Full Text:
<p>You can use this example to read database records that should be shown as latest publications.</p><hr><h4>Source Code</h4><p>Please paste this code snippet into your template to see how it works.</p><blockquote><p><small>Let's experiment with a template like <code>tiny.news.feed/Themes/default/404.tpl</code> by pasting code into it and then opening some <a href="some-indefinite-vague-non-existent-abracadabra" rel="nofollow">non-existent page</a> associated with that template.</small></p></blockquote><pre><?php $TEST = $cms->getLatest(); foreach ( $TEST as $type => $sublist ) { if ( $sublist ) { echo 'Publications of kind ' . $type . ' <br>'; echo '---------------------------------- <br>'; foreach ( $sublist as $item ) { echo $item['title'] . ' <br>'; } } } ?></pre><blockquote><p><small>Note that the <code>$cms</code> variable is a system pointer to your web application. And <code>getLatest</code> is a public method for reading the latest publications. If you are interested in the algorithm of this method, look at the file <code>tiny.news.feed/Application.php</code>.</small></p></blockquote><h4>Remark</h4><p>The public method used above has two optional arguments:</p><ul><li>The <code>$size</code> parameter is intended to specify the capacity of each sublist.<br><small>The default size is 6 (that is, 2 * 3 publications).</small></li></ul><ul><li>The <code>$filter</code> parameter is intended to provide a list containing only names of specific kind.<br><small>The default value is an empty list for reading the latest publications of any kind.</small></li></ul><p>The return value is a name-indexed list of sublists retrieved from the database.</p><hr><h4>How to get specific latest pages?</h4><p>In the following code snippet, we will read a list of 4 latest <code>news</code> and 4 <code>articles</code> and put it into the variable $TEST. We will then iterate through this list to print its sublists.<pre><?php $TEST = $cms->getLatest(4, [ 'news', 'articles' ]); foreach ( $TEST as $type => $sublist ) { if ( $list ) { echo 'Publications of kind ' . $type . ' <br>'; echo '---------------------------------- <br>'; foreach ( $sublist as $item ) { echo $item['title'] . ' <br>'; } } } ?></pre><p><small>* This page is a demo post designed to display page content for testers. You need <a href="news/demo-posts/faq/how-to-get-latest-pages/delete" rel="nofollow">delete this page</a> when you run the website in production mode.</small></p>
You can use valid HTML markup for this field. All HTML tag attributes will be removed for security reasons except attribute href="some-url" for tag <a> and attribute src="some-url" for tag <img>.
Image to upload:
The file length should not exceed 5 megabytes. File type: WEBP, JPEG, PNG, SVG, GIF or BMP.
Image URL:
http://mimimi.software/demos/TinyNewsFeed/
You should enter the image URL manually if your page needs to have an image with a specific file name. Otherwise, the image URL will be set to the name of the uploaded file. If you need an external image on your page, enter its absolute URL here and do not use the input field above to upload the image.
Send »
× Cancel