[SOLVED] Trying to include a separate page

Welcome to the WonderCMS community. Anything goes, except for support requests.
Post Reply
wdq
Posts: 11
Joined: Fri Dec 02, 2016 11:44 pm

[SOLVED] Trying to include a separate page

Post by wdq »

According to theme.php menu is automatically generated as a slug what I am trying to achieve is:

1. Create a theme2.php remove the main content.php and add my own div with changes. ( Is it possible to create a second page with the same header, menu, subside, footer but only to include my own code instead of php content tag ?)

2. Add a link to the menu , so it can actually appear like a part of the WCMS website. ( can I add in main theme.php menu a, href to link to the second page I want to create?)

Thank you very much !
User avatar
nox
Posts: 58
Joined: Sat May 23, 2020 9:02 pm

Re: Trying to include a separate page

Post by nox »

Hey wdq,

Wonder CMS documentation how to create a custom page template:
https://github.com/WonderCMS/wondercms/ ... e-template

Page name and template name should be the same. Then check show page visibility in the menu.
If the page you want to apply a different template is named custom-page, create a new template custom-page.php
Inside custom-page.php where

Code: Select all

<?= $Wcms->page('content') ?>
is located, you can add custom html or php (using text editor).
Delete "page(content)" line inside the template or just remove the default text from content box while in the admin area.
wdq
Posts: 11
Joined: Fri Dec 02, 2016 11:44 pm

Re: Trying to include a separate page

Post by wdq »

Thank you very much for the answer, in the meantime i noticed that if i create a new page let`s call it EXAMPLE add all the necessary , page title etc and after a folder with the same name and add your index.php ot html will go there when clicked on the button , now i am experimenting with creating one more .php and try to get all the header menu subside and everything without the content , so i can add my little script in and see how it goes, i will come back with updates as soon as i manage to finish what I am cooking :)))
Post Reply