The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
Get a list of available pages from pages.array - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: Get a list of available pages from pages.array (/showthread.php?tid=2044) |
Get a list of available pages from pages.array - polyfragmented - 2011-08-05 I have a one-page site in development and would like to automate a component which I place on the page via the DynPages plugin. Said component holds the markup for the in-page sections which are output to the page via the SimplePageContent plugin. I did some research on the forums here and found two related threads, but I have to admit that I don't grok the menu_data() function. I then thought maybe the pages.array file generated for caching might help since I would "merely" have to extract the available pages. My current, manually updated, structure looks like the following (basically the same for each section on the page): Code: <div id="seite-info"> Can someone give me a few pointers on how to extract a page list from the pages cache in 3.1b? I think I'll need an array of slugs which I can loop through and populate the above mini template with. Help is much appreciated. Get a list of available pages from pages.array - n00dles101 - 2011-08-05 The internal caching makes all the data available into a global array $pagesArray for use on your pages. So you can just loop through it like so: Code: function listPages(){ MIke,. Get a list of available pages from pages.array - polyfragmented - 2011-08-05 I basically got it to work with your help, thanks so far! What I can't fix yet is that the array doesn't list the pages in the order that they appear in the navigation. So my content is tossed around the page. Edit: print_r() for the win! I'll try and sort by [menuOrder]. Get a list of available pages from pages.array - n00dles101 - 2011-08-05 updated code should do it for you... Code: function listPages(){ MIke,. Get a list of available pages from pages.array - polyfragmented - 2011-08-05 Unfortunately, it doesn't, Mike. :/ Now there's no output at all here and an print_r($pages) outputs nothing either. Tried putting a global $menuArray; at the top as well, to no avail. Been researching arrays, their sorting, etc. for an hour now, only slowly getting a grip on this. Get a list of available pages from pages.array - polyfragmented - 2011-08-05 The following seems to work Code: <?php I just replaced $menuArray with $pagesArray. Get a list of available pages from pages.array - n00dles101 - 2011-08-05 Oops, sorry copy/pasted from some code , never check the vars... RE: Get a list of available pages from pages.array - MicroCAD - 2015-08-01 Hi, Is there a way to loop like this only into pages of a certain language? Thanks! RE: Get a list of available pages from pages.array - Angryboy - 2015-08-12 Since the language is tied to the suffix of the slug (e.g. index_de ), you can perhaps try parsing that:PHP Code: // Initialize some variables to be used in the loop (Not tested yet) |