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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.