psy

Regions on basic page

3 posts in this topic

I am using regions with the tag <region id="whatever"> in the _main.php file. Config file is set up as follows:

$config->useMarkupRegions = true;
$config->prependTemplateFile = '_init.php';
$config->appendTemplateFile = '_main.php';

When I use a page template that changes a region, all goes well. However, I set up the _main.php file to reflect the output for a basic page. The basic-page.php template needed no customisation so was simply as follows:

<?php namespace ProcessWire;
?>

When a page with the basic-page template was output, all the <region> tags remained in the HTML, ie were not stripped.

When I added a customised region to the basic-page.php template, all the <region> tags were stripped from the output _main.php HTML.

Did I do something wrong or is this a bug?

Using ProcessWire 3.0.63 © 2017 

 

Share this post


Link to post
Share on other sites

Quick workaround... in _main.php add

<region id="dummy"></region>

in basic-page.php add

<region id="dummy"></region>

Seems PW needs a region in the page template to kick-start the process.

2 people like this

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By didhavn
      Hey everbody.

      I wanted to share something I have been working for quite some time, in total currently three premium Templates or Site-Profiles for ProcessWire 3 including a onepage template, a blog template and a blog+sidebar template.
       
      Here are some Quick Facts:
      Fully responsive Multilanguage support Full SEO support Optional Google Analytics Easily create new pages out of multiple predefined sections Lazyload the sections of a page [Group and update website-information into blogs] (blog, blog+sidebar) [Use tags to tag and group blog entries] (blog, blog+sidebar) [User-comments] (blog, blog+sidebar) [Create each page with or without sidebar] (blog+sidebar) Website-wide search by text or tags Password protect each page individually with sophisticated page-encryption with dummy texts and pixelated images
      Just go to https://pwtemplates.de to test the demos (e.g. blog-sidebar) and purchase them for a small expense allowance.
       

      Hope you like it!
    • By ARG
      Hello. Sorry in advance for the super basic question, from a total begginer: 
      -when I want to create a new template in the admin, I have to create firstly a ''new.php'' page in the site/template folder. 
      -Is it possible to do the same in an ''_new-include-some-page.php''  in the site/template/include folder?
      I was thinking to a solution: removing the Include folder, and put all the .php pages in the template folder.
      But, I am sure I am missing something, and other solutions exist.
      An advice?
      Thank you for your time.
    • By louisstephens
      I wasn't quite sure where to post this, as this is a question regarding the module (sorry if it is in the wrong place). I was wondering if anyone has used the Email to Page module and figured out a way to "move" incoming css to another field, or how to render the css so the message just renders utilizing the css. 
      Right now all of the message contents get dropped into a textarea field and display in a template as a jumbled mess. Perhaps I am missing a formatting option in the text area field to render the css and html.
    • By Sipho
      I wish to access a template's allowed templates for it's children from the API. This one:

      I am pretty sure this is possible, but I can't seem to find it anywhere in the documentation. If this is not possible, is there some way of assigning properties to templates? So like fields that already have a value on all pages using that template.
    • By nusu
      My site works very well until today I fill a bunch of multilanguage fields than suddenly it start to this.
      I can't reach any page, everything gives 500 error.
      and log is:
      2017-07-12 09:33:56    guest   Error:     Class 'Twig_Loader_Filesystem' not found (line 338 of /home/petform/public_html/site/modules/TemplateTwigReplace/TemplateTwigReplace.module)
      How can I fix this?