OctoberCMS does not show static pages from template - php

I have a fresh installed OctoberCMS with the static pages plugin.
I have a template from another OctoberCMS installation with the static pages and their content.
For example I have a main page with the URL /.
This is also displayed correctly when I call it in the browser, but it does not appear in the backend under the static pages. So I can't edit it there anymore.
Also I can not create a new page with the URL /. The system seems to have understood that the page exists. But why is it not displayed in the backend?

It sounds like you're missing the static-pages.yaml file.
You'll find this in /themes/yourOldTheme/meta/static-pages.yaml
So you'll need to copy all the .htm files out of your old theme like you've already done. But you also need this static-pages.yaml so they all appear in the static pages list on the OctoberCMS backend.

Hmm, it may be possible that page can come from the CMS/Editor Module.
You can check the full article here How To Add Pages In October Cms.
Please check CMS module, maybe your page can come from there if it's not
defined in static pages.
In OctoberCMS v1
In OctoberCMS v2
If you doublet please comment.

Related

My Concrete5 Page Types Will Only Use Default.php

For some reason, my theme will not use any of the .php templates that I have built. For instance, in my theme file, there is a template called "gridLayout.php" In Page Types I have created a "Grid Layout" page type with handle "gridLayout"—shouldn't that be all I need to do? I cannot see the template in the Defaults mode, or when I create a specific page of that type. I also tried de-activating and re-activating the theme, thinking that would refresh things; still nothing. I must be missing something simple.
page types ought to follow concrete5 naming rules, grid_layout.php is preferred to gridLayout.php also concrete5 will only ask you to register a new page type upon theme installation or using the inspect button.
There are a couple of options here. One, de-activating the theme is not enough. Uninstalling and installing the theme will restart the process of identifying page types. Even easer though is the "Inspect" button for the custom theme. It will identify page templates that are not being used and ask you to create said page type.
Check your cache settings in Concrete5. Make sure you turn off all caching while developing.

Make special pages from WordPress theme?

I'm trying to figure out how a certain WordPress sets things up. I'd like to have a special page where I could make WP calls and interact with the theme, without affecting anything else.
I just making test.php and putting it into my theme's folder, but that doesn't work.
#Eliran provides one possible option, but you could also add a page in the back-end of WP, just make sure it has the slug 'test', and change your 'test.php' filename to 'page-test.php'. If you're worried about the public seeing this, set the page visibility in the admin to 'private'.
Edit:
to move your understanding along a little further also, you should review the way that WordPress determines what file to grab to render a particular URL. This can be pretty confusing to start with, so be patient if you're not familiar with it, but it's at the heart of designing WP themes. I'll link to the examples, and if you scroll down a little there's a diagram that, along with the text, will help you see how WP is 'thinking'.
http://codex.wordpress.org/Template_Hierarchy#Examples
You can see here: Page Templates
all you need to do is create a page named page-{custom-name}.php and add it to the theme folder.
and inside this php file add:
/*
Template Name: My Custom Page
*/
and than to use this page you need to go to the wp-admin, add/edit a page and chose it:
inside the php file everything you do is classic wordpress.
all this is giving you is a custom page tamplate.
Put it in your root folder. When you go to look at it, you'd look at www.mywebsite.com/test.php
It may be other ways to do this, but I rather use the rewrite API and custom query vars, to create custom routes.
A previous answer on the subject can be found here
The basic idea is to add a new url rule, catch the query var with the parse_request filter and maybe do a die or redirect to prevent the default wordpress template from loading.
I prefer this over theme templates, because with templates you need to create a page for each new url, and if that page gets acidentally deleted, that functionality would stop working.
What Pages are Not:
Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog's main page. WordPress Plugins are available to change the defaults if necessary.
Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
Pages are not files. They are stored in your database just like Posts are.
Although you can put Template Tags and PHP code into a Page Template file, you cannot put these into the Page or Post content without a WordPress Plugin like Exec-PHP which Read overwrites the code filtering process.
Pages are not included in your site's feed.
Pages and Posts may attract attention in different ways from humans or search engines.
Pages (or a specific post) can be set as a static front page if desired with a separate Page set for the latest blog posts, typically named "blog."
More About Pages.
In WordPress to add a new page you have to log in to the admin/backend and from the pages menu you can add a new page. In this case, you can select templaes for your page and also you can create a custom page template for that page.
You may read Createing a new page in WordPress. and custom Page template in WordPress.

Adding my own static webpage to a wordpress site

If my title wasn't clear, basically what I'm trying to do is to add my own HTML or PHP page to Wordpress, so i can play around with some web dev.
So essentially I just want a test page/pages added to my site. However since I have installed Wordpress on my website, I can't just add "index.html" to my root folder using my FTP client. I wonder if I can/can't do this and if so how to link to the pages I add using FTP.
Sorry if this doesn't make any sense. I just want to add some of the sites I've already made / ones I am creating to my site so I can easily show clients/employers what I can do, and I apologize again if I'm being an idiot.
Create a sub-directory in your root folder and then simply link to it:
www.domain.com/mysubdir/index.php
the other way to do this... create a page template in wordpress
create a php file named: template_mypage.php
You must put this php comment line at the top of your template file:
/* Template Name: My Page */
go to wordpress backend and create a new page
in the "Page Attributes", you can find a drop down list named "Template". In the list, you should be able to find "My Page"... select it and then save your page.
view it!
You can always create a subdomain or create a folder inside public_html/www/ and redirect it from any other domain or from any static link you have on wordpress
Why not use WordPress and put your portfolio together using Custom Post Types? I recently presented on this and there is a handy plugin for Custom Post Types UI that you can create a whole new section of your site and make templates for your portfolio.
Just a thought.
If you do a static page in WordPress, you can still template using the Page system as specified in another comment. Code your page, separate it into header, footer, content, etc files. You can load the file to your root, but not name it index. If you do a subfolder, you need to not have an existing page in WordPress.
HOWEVER, you can still do a "halfway" static page still using WordPress and do a header-staticpage.php, index-staticpage.php, and footer-staticpage.php and make sure to include the code for WordPress header and footer in the new header and footer so you can still reap the benefits of the default jquery that WordPress allows. Don't forget to name your template and when you create the page in WordPress, you can just leave the content area blank if you have hardcoded the page's content in.
I still recommend trying Custom Post Types. It is not hard and there are some great presentations in Slideshare that cover this aside from the plugin I mentioned earlier in this comment.

Intergrating ATK4 with wordpress development

I found a article on the atk4 blog http://agiletoolkit.org/blog/integrating-agile-toolkit-with-wordpress/ I followed the instructions and i get a error and it says the ApiWeb Class not found. Then I looked in index.php on the real framework that you download and it initializes everything differently then the blog post did so. I'm wondering if ATK4 can be integrated or maybe I'm doing something wrong?
I'm also currently integrating a wordpress site with ATK4 at the moment.
The ApiWeb.php class is present in the atk4/lib directory in both 4.2 and 4.1.3 versions of atk4 so not sure why you are getting an error.
What is suggested on the blog page about integrating ATK4 with wordpress is that you would load the ATK4 libraries as php embedded in the pages so you would need to ensure you change the include line based on where you have placed the atk4 files.
<?php
include 'atk4/loader.php';
$api=new ApiWeb('sample_project');
$api->add('jUI');
.. .. ..
$api->execute();
?>
I havent tried this but think you would need to verify the path to ATK4 is correct.
I've taken a different approach to integrating Wordpress and ATK4 - rather than embedding ATK4 into the pages as per the blog article you referenced, i'm going with installing wordpress in one installation and ATK4 in a separate one and using the same template in both.
The wordpress template i'm using is from themeforest and it came with a WP folder containing the Wordpress files plus a HTML folder that contains example pages. I took one of the HTML pages and created a new templates/default/shared.html inserting the atk4 tags such as in the appropriate places.
I've created a menu in Wordpress Theme->xxx->Menu which are mostly static pages from Wordpress and one menu option which is a link to the start of the ATK4 root. Because i'm using the same template, it looks like a single site. In my case, i'm not using the login functionality of Wordpress - all the wordpress pages will be accessible without logging in but i am using a dynamic second level menu and options based on the logged in user which will be defined in Frontend.php
The ATK4 menu gave me a problem because it wasnt consistent with the site and after a while trying to style the menus with CSS and create a submenu using Menu_Basic and Menu_Lite, i went with using ATK4 Views and split the HTML from the wordpress theme, to create a menu.html, a submenu.html and a menuitem.html and have set this using code in Frontend.php
It's still a work in progress so i can't provide the link at the moment as it's not online yet but it seems to be working and may give you other ideas depending on what you want to achieve with integrating ATK4 and Wordpress.
If you want to have a common login for ATK4 and Wordpress (using ATK4 to control the access each user has), there is a plugin for Wordpress that might help with external DB Auth so you could use this with the BasicAuth of ATK4 instead of using Wordpress Auth functionality.

How to insert a static page in WordPress

I have WP instance installed on hosting. I also have one static HTML page in its own folder with some graphic files that I want to use as landing page for the site. I don't want to insert it as WP page or anything like that, want to keep it simple. I have also permalinks configured. So I can't access the page just by going to www.mysite.com/landingpage/index.html now. Is there a simple way to make the static page accessible inside WordPress instance?
For each page, create a template, with the static text you want, the query for the category you want to display, and a copy of index.php of your theme.
Some links you may like to see.
http://wordpress.org/support/topic/creating-a-static-page-that-displays-posts
http://moshublog.com/2007/09/10/static-frontpage-combined-with-dynamic-content/
Wordpress static pages: how to embed content into templates?
Good luck.. :-)

Categories