1
rossb
Include all files (sorted) in a template directory
  • 2020/11/5 14:12

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Hi;

xoops 2.5.9
site: http://www.rossco.org

Management of a menu template file is getting unwieldy due to large number of menu items. I want to split things by submenu, where submenu items are in a directory and include whatever items are in the directory, sorted by order. For example:

directory
00_Item1
01_Item2
...

This will allow me to easily edit a particular menu item without wading through a large file referencing the items individually.

I note that template files can be included individually by:
<{includeq file="$theme_name/tpl/some.tpl"}>

I want to do this:
<{includeq file="$theme_name/tpl/some_directory/*.tpl"}>
where they are included sorted as above

does "includeeq file" work on wildcards, as above, or is there another way to do this?

Smarty doc'm (for include) sez no:
https://www.smarty.net/docs/en/language.function.include.tpl

Have not found any doc'm for includeq for xoops

Thanks;
Bill

2
Mamba
Re: Include all files (sorted) in a template directory
  • 2020/11/6 9:59

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


You could use the
getFileListAsArray($dirname$prefix '')

function from XoopsLists, and then pass that array to Smarty
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
rossb
Re: Include all files (sorted) in a template directory
  • 2020/11/6 20:58

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Thanks Mamba;

I assume using foreach...

4
Mamba
Re: Include all files (sorted) in a template directory
  • 2020/11/7 9:07

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Yes
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

364 user(s) are online (285 user(s) are browsing Support Forums)


Members: 0


Guests: 364


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits