Replies: 6 comments 2 replies
-
The easiest way would be to save the page with extension
Try: echo Pages::from('.\path\to\page-folder')->count(); Or, you can also do that in the raw way: echo q(g('.\path\to\page-folder', 'page')); Related: #122 |
Beta Was this translation helpful? Give feedback.
-
what worked ---> echo $pages->count(); <--- thank you for your super-fast reply! is their a way to show/echo the last modified/last updated time? and a genernal question, as i work with mecha for the first time, i have build-in 3 custom-fields as data in layout, is there a better/faster way to do it? i love the simplicity of mecha, everything is where it should be - the panel is great! |
Beta Was this translation helpful? Give feedback.
-
By default, Mecha does not have last updated data because to generate such data requires a GUI form to store the current time to a file. As alternative, you can get page’s file modification time. But this does not guarantee that the value will remain consistent across copy/paste/move actions. $updated = new Time(filemtime($page->path));
echo 'Last update: ' . $updated->en; |
Beta Was this translation helpful? Give feedback.
-
Please note that Try this to show the total article pages: echo Pages::from(LOT . DS . 'page' . DS . 'article')->count(); |
Beta Was this translation helpful? Give feedback.
-
If the value is constant, you can put them as default states: State::set('x.page.page', [
'foo' => 1,
'bar' => 2,
'baz' => 3
]); If the value is dynamic (you need to fill it manually), you can add custom fields. |
Beta Was this translation helpful? Give feedback.
-
@ttrack I have moved your issue to the discussion tab. |
Beta Was this translation helpful? Give feedback.
-
hello,
how can i exclude a page from the menu/nav?
i looked at reference but can´t figure it out.
also how can i count the total pages from article (the total pages from one page) and echo it.
thank you in advanced.
have a nice day
ttrack
Beta Was this translation helpful? Give feedback.
All reactions