Displaying the content of two or more articles

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
prodesign
Posts: 3
Joined: Fri 14. May 2021, 11:32

Displaying the content of two or more articles

Post 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?
User avatar
Oliver Georgi
Site Admin
Posts: 9757
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Displaying the content of two or more articles

Post 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.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
prodesign
Posts: 3
Joined: Fri 14. May 2021, 11:32

Re: Displaying the content of two or more articles

Post 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.
User avatar
Oliver Georgi
Site Admin
Posts: 9757
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Displaying the content of two or more articles

Post 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.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
prodesign
Posts: 3
Joined: Fri 14. May 2021, 11:32

Re: Displaying the content of two or more articles

Post 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 :-(
User avatar
Oliver Georgi
Site Admin
Posts: 9757
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Displaying the content of two or more articles

Post 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.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply