Custom template for the pages

Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm
Been thanked: 1 time

How should I use this option?
Image

Do I need to write something else in the index.php?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

The function is not yet implemented.

But you can modify the if conditions in the file index.php of your theme.You can for example use an own template contact.php for your contact page with the following:

Code: Select all

if ($WHERE_AM_I == 'page') {
   if ($page->slug() == 'contact') {
      include(THEME_DIR_PHP.'contact.php');
   } else {
      include(THEME_DIR_PHP.'page.php');
   }
} else {
   include(THEME_DIR_PHP.'home.php');
}
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm
Been thanked: 1 time

YEAH!
Thanks!

And when this feature will be implemented?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Artem wrote: Sun Mar 17, 2019 7:44 pm And when this feature will be implemented?
Sorry, no idea at the moment.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm
Been thanked: 1 time

Ok.
I did like this:

Code: Select all

if ($WHERE_AM_I == 'page') {
	if ($page->template()) {
		include(THEME_DIR_PHP.$page->template().'.php');
	} else {
		include(THEME_DIR_PHP.'page.php');
	}
} else {
	include(THEME_DIR_PHP.'blog.php');
}
Bludit 3.8.1 pro
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Thank you, I didn't know that this is possible! :oops:
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
jmonroe
Sr. Bludit
Posts: 38
Joined: Mon Feb 22, 2016 8:06 am
Location: USA
Contact:

Nice workaround @Artem So Edi...now we know :D
Jeremy Monroe
I Support Bludit via Patreon
User avatar
Torsten_Kelsch
Legend Bludit
Posts: 263
Joined: Thu Aug 27, 2015 10:24 pm
Location: Germany
Has thanked: 4 times
Been thanked: 2 times
Contact:

Nice workaround, but it would be better if editors could choose the template in the backend while creating a page (if there are different templates in the theme). Some CMSs offer such a function, and it makes the CMS really flexible, regarding the design.
On Error GoTo Bed
ehandelsforeningen
Jr. Bludit
Posts: 4
Joined: Thu Sep 05, 2019 11:37 am

How do we assign a menu structure to the static content (pages)? Using the pro version, I cannot assign another static parent to the content after choosing static as the format.
User avatar
Torsten_Kelsch
Legend Bludit
Posts: 263
Joined: Thu Aug 27, 2015 10:24 pm
Location: Germany
Has thanked: 4 times
Been thanked: 2 times
Contact:

ehandelsforeningen wrote: Sun Sep 08, 2019 3:33 pm How do we assign a menu structure to the static content (pages)? Using the pro version, I cannot assign another static parent to the content after choosing static as the format.
Static content cannot have child pages.
On Error GoTo Bed
Post Reply