Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION Loop trough pages
#1
Hello GS-users,

Is there a way looping trough the pages similar like a blog-website?
I know there are great plugins like News manager, but building my own theme and will adding a foreach-loop in the code itself without plugin.
Someone has experience with this?
Or are there code-snippets in this forum how develop it?

PS: searching this forum with the word: 'ĺoop', but no results Sad

Special thanks to @multicolor and co, for rebuilding the GS CE-edition, thats the reason i will retry GS for my next projects.

Regards,
Christophe
Reply
#2
Quote:Is there a way looping trough the pages

The GS api has plenty of possibilities to use with a php loop ..... for next
If I have time I can find some examples.
Reply
#3
(2023-01-21, 00:27:26)Felix Wrote:
Quote:Is there a way looping trough the pages

The GS api has plenty of possibilities to use with a php loop ..... for next
If I have time I can find some examples.

Hi Felix,

Thanks for your fast answer.
My blog https://gewoonsimpel.be/ is build with Bludit, but i try doing research, if i can rebuild it in GS with all the bells and whisles (single page navigation, date field, tags, categories, comments,...), If i found solutions for all this options, then i give GS a try ?
Reply
#4
Quote:If i found solutions for all this options, then i give GS a try ?

I know about Bludit and it has it's place. But GS has attracted more experienced coders who created more professional plugins. Just have a look in the GS plugin repository. Also GS has a backend that is very easy to use for both an end user and a coder. On top of that GS is very php friendly, just have a look at the GS api. So yes I would certainly give it a try.
Reply
#5
(2023-01-21, 18:02:59)Felix Wrote:
Quote:If i found solutions for all this options, then i give GS a try ?

I know about Bludit and it has it's place. But GS has attracted more experienced coders who created more professional plugins. Just have a look in the GS plugin repository. Also GS has a backend that is very easy to use for both an end user and a coder. On top of that GS is very php friendly, just have a look at the GS api. So yes I would certainly give it a try.

A few years ago, found GS and yes, it is very attractive cms. But for some reason chosen for WP. Did a lot with WP, but after years, i hate it, so for all the issues update plugins and so on. Now these days, i love more and more flatfile cms-systems.
Tested and tried many flatfile systems:
- GRAV
- Automad
- PicoCMS
- HTMLy
- Bludit
-...
The most of them has a lack of updates, and some feels 'dead', and has no active community.
The reason i choosing Bludit, it has a nice (not complete) dashboard and relative easy building plugins for it. (have some basic php knowledge) But version 4.0, it's feel 'frozen' for years.
And yes, i like GS, it looks very flexible for coders and easy to manage. The reason why i will give GS a try, is thanks to @multicolor and co, for making the GS CE-edition, and hope that there are new regular updates come in the (near) future.
Reply
#6
In the meanwhile i found a code snippet that loop trough the pages:

https://avinashsing.sunkur.com/2011/08/1...n-sidebar/

Adding custom fields, with some code it is easy showing all the fields you need. AWESOME!!!
Reply
#7
Hi@tuxy
Good find and thanks for sharing that script with us
Remember that anything can be "a page" in the GS cms (web page, post page, data page, config page, function page, etc.)
Welcome to GS and the community
Reply
#8
(2023-01-22, 01:24:35)Felix Wrote: Hi@tuxy
Good find and thanks for sharing that script with us
Remember that anything can be "a page" in the GS cms (web page, post page, data page, config page, function page, etc.)
Welcome to GS and the community

@Felix no problem. Okay good to know.
In the next weeks i will try some 'things' with GS.
First and most important, the loop works perfect! 
Second i think about the categories: using parent Pages as categories and thé child Pages thé blogposts.
It's a start :-)
Reply




Users browsing this thread: 2 Guest(s)