Jump to content

Creating a theme/template system


_Unique_

Recommended Posts

Hello,

I am currently working on a project. I am wanting to implement a theme/template system, where the user can install themes/templates which will upload the folder/files into the theme folder where the website will scan all directories inside the theme folder and list all directories found, as themes.

 

However, I cannot figure out how I can go about creating this.

I am really confused, especially as I have tried countless times attempting to organize and plan the system in my head in the past couple of weeks.

 

Could someone please explain to me, how I could go about doing this?

As I said before, I already tried to have the name of the main theme in the database, where I would retrieve that name of the theme via a query. But then I couldn't figure out how I could link all the stylesheets that was in the theme folder. (If that makes sense, unfortunately I am so confused, that nothing is currently making sense - if that makes sense..)

 

Anyway, I pretty much need to figure this out, with some help from you :)

 

Thanks in advance,

 

Unique

Link to comment
https://forums.phpfreaks.com/topic/297128-creating-a-themetemplate-system/
Share on other sites

In this situation, I'd recommend using a templating system such as Twig. Assuming you have a constant base themes directory, so you can store the current template directory name in the database, grab that value, append it to the base theme directory path, and feed that to the Twig_Loader_Filesystem() constructor for use in rendering.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.