Page 1 of 1

Displaying the content of two or more articles

Posted: Fri 14. May 2021, 13:30
by prodesign
Currently phpWCMS allows you to display one article or a listing of two or more articles. Is it possible to display the entirety of two or more articles?

Re: Displaying the content of two or more articles

Posted: Fri 14. May 2021, 13:43
by Oliver Georgi
It depends on how you build your system and how you define "article".

It's possible to load full articles like for one-pagers using Ajax or frontend render which based on special comments in the template.

Try inside your template:

Code: Select all

<!--ONEPAGE_START//-->
{CONTENT}
<!--ONEPAGE_END//-->
Then call one page in the browser:
index.php?mypagealias&phpwcms_output_action=F-trim--S-ONEPAGE

With this in mind it's relatively easy.

I have projects where such elements are loaded and cached.

Re: Displaying the content of two or more articles

Posted: Fri 14. May 2021, 14:12
by prodesign
I mean the ability to display all articles with the content in the category:

https://wiki.phpwcms.org/lib/exe/detail ... %3Aarticle

I am looking for a simple option to create a one-page page with a menu for articles.

Re: Displaying the content of two or more articles

Posted: Fri 14. May 2021, 15:44
by Oliver Georgi
I understand what you mean, and as described above this is how it can work.

There is no built-in mechanism to catch multiple articles in once. You need to write a wrapper to fulfill this.

Check the onepager checkbox under structure level and see what happens to the menu links.

Check this https://www.dr-plank-kelheim.de/ it's built on the above concept.

Re: Displaying the content of two or more articles

Posted: Fri 14. May 2021, 17:49
by prodesign
I checked:

"OnePage ID (#anchor) support " in the "site structure"
and
"treat as OnePage template" in the template

but no work.

/localhost/test/index.php?home&phpwcms_output_action=F-trim--S-ONEPAGE
shows only one article.

Maybe I'm doing something wrong :-(

Re: Displaying the content of two or more articles

Posted: Fri 14. May 2021, 19:51
by Oliver Georgi
This is a bit more complex. You just need to take the code I posted above and place it in a template to understand the concept behind – accessing then a page extended by parameters phpwcms_output_action=F-trim--S-ONEPAGE.

Menu and everything else is based on your site structure and what you really wan to do. I have no time to explain it in detail here.