Page 1 of 2

Custom template for the pages

Posted: Thu Mar 14, 2019 11:51 am
by Artem
How should I use this option?
Image

Do I need to write something else in the index.php?

Re: Costom template for the pages

Posted: Sat Mar 16, 2019 11:49 pm
by Edi
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');
}

Re: Costom template for the pages

Posted: Sun Mar 17, 2019 7:44 pm
by Artem
YEAH!
Thanks!

And when this feature will be implemented?

Re: Costom template for the pages

Posted: Sun Mar 17, 2019 10:56 pm
by Edi
Artem wrote:
Sun Mar 17, 2019 7:44 pm
And when this feature will be implemented?
Sorry, no idea at the moment.

Re: Costom template for the pages

Posted: Tue Mar 19, 2019 6:25 pm
by Artem
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

Re: Costom template for the pages

Posted: Tue Mar 19, 2019 10:54 pm
by Edi
Thank you, I didn't know that this is possible! :oops:

Re: Costom template for the pages

Posted: Sun Mar 24, 2019 1:45 pm
by jmonroe
Nice workaround @Artem So Edi...now we know :D

Re: Custom template for the pages

Posted: Tue May 28, 2019 9:07 pm
by Torsten_Kelsch
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.

Re: Custom template for the pages

Posted: Sun Sep 08, 2019 3:33 pm
by ehandelsforeningen
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.

Re: Custom template for the pages

Posted: Mon Sep 16, 2019 11:29 pm
by Torsten_Kelsch
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.