Jump to content

Theme creation with multiple templates


LinuC

Recommended Posts

Hi

I had a WP website, but because of performance problems I turned it into a static website, with a plugin. Now I have been looking for a solution to rebuild my website for some time.

A completely static website would be best. But since I would like to have a search function and also need a language switcher, I'm not sure if a static website generator is the right thing. Maybe more of a flatfile CMS? Ok, I have looked at various tools and realize that you always end up in a dead end, because each tool has its own methods, which are not compatible with other tools. All open-source, but not open-mind?

Now I try it without a tool. Whether it will be a static website, or a "minimal CMS", has not yet been decided. But in any case, it needs a theme. And already the problem begins, with which method should I tackle it. Is it best with a traditional one?

I want a theme with only 3 sections, navbar, content and footer. These 3 should be built into a base template. This base temeplate should then be integrated into the page. Why so complicated? So that I can easily edit each of the 3 partial templates, even if many pages already exist. I would also like to leave open the possibility of inserting another partial template, for example a sidebar.

But I don't understand the method. Suppose I integrate the 3 templates navbar, content and footer in base.html and then base.html in the page, where do I then create the content? Does the content also come into the page, or does it come into another file, which is then displayed in the content section?

I want to install an automatic TOC in the page. So this should be in the template content.html and not directly in the page, right?

Some functions are integrated in the navbar, including a search function, print function, top of page and the language switcher.

A text should appear in the footer with references to the method of the website, for example, what it was created with. This text should be in different languages, depending on the language switcher setting.

Does anyone know a step-by-step guide to create something like this? On the Internet I find a lot of instructions, but each one says something different.

Here a link to two pdf of a non-functional prototype, so that you have an impression of how it should look like.

2 pdf with more details

The actual navigation is directly in the home page, as a "grid-nav". I created the prototype with Grav and Gantry5, but I would be happy if I didn't have to put myself in the hands of a tool that you don't know if and how it goes on. I already had this problem with WP.

Thanks for good ideas and good instructions/documentations!

Link to comment
Share on other sites

After my daily walk and some reflection:

Why don't I just do it with a single template? All in one (navbar, content, footer), only css and functions in additional files. 

I created my first website in 2009, all just html files and a css with 5 lines. It is already a grid-nav, just no navbar, you need to use the browser functions and close tabs to navigate. I make changes with a text editor and, if necessary, with search/replace over several files. This method always works.

PortalPB

Since with grid-nav method the menu is located directly in the page, there are no problems if you have to adjust the menu, because it is NOT part of a section that belongs to all pages, like sidebar or navbar. So the changes only affect the grid-nav pages, at most in different languages.

I can do the language switcher with a pulldown and relative links, for example from /en/basics.html to /fr/basics.html . I just need to adhere to the structure correctly. And maybe I can even take the file name from the URL?

I could switch the text in the footer with some div, from one language to another. Or can I query the lang of the page and use it?

Maybe this is the better and easier method than dealing with all these new template methods, just to create a single website skeleton, for websites that are really practically static, i.e. which have content that hardly changes. That's what static websites are all about, not whether you need php, js or something else.

Here is my WP website, but now as a static version, done with a plugin from WP. Works good and fast, just the code of the pages is a bit difficult 😉

LinuC

Edited by LinuC
Link to comment
Share on other sites

  • 1 month later...

Come up with a list of requirements.

Must do these things:

  • A
  • B
  • C
  • D

Would like to also do these things (if possible)

  • A
  • B
  • C

Keep each bullet point one sentence or less (easy to read and understand by other people).

This is your 'requirements' document.

All of the things you described can easily be done with HTML / Javascript / CSS.

WordPress just makes it more complicated.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...