Jump to content

ridgedale

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by ridgedale

  1. Hi, I've separated the header and footer information from the _main.php (_header.php and _footer.php). This works fine with any top level page but any page children are rendered without the header and footer information. When I add includes to the blog-post.php, for example, and try refreshing the page the following error is returned: The line of code being referred to is: echo ukBlogPost(page()); Could this error be being generated because I am working locally using MAMP? Any assistance would be greatly appreciated.
  2. Hi, I'm trying to append a contact form to the existing contact page content. The existing content for the _main.php page is as follows: <div id='content-body'> <?=page()->body?> </div> I've created a contact.php page and have included the following code but the form is not being rendered: <?php namespace ProcessWire; // This is the form for the /contact/ page. ?> <div pw-append="content-body"> <div id="contact-form"> // ... contact form details here </div> <p>&nbsp;</p> </div> The following is returned in debugging mode which doesn't appear to be of much help: Any thoughts on what I am doing wrong? Any help appreciated.
  3. Hi @AndZyk, Bingo! Adding the following to the top of the hader.php file resolved the issue. Thanks for your help. Very much appreciated.
  4. Hi @AndZyk, Thank you for your reply. Unfortunately that code does not render the header.php content, as I already indicated. When I rename the file to header.php and add the the following code as suggested at the top of the _main.php file: <?php namespace ProcessWire; // _main.php template file, called after a page’s template file $home = pages()->get('/'); // homepage $siteTitle = 'Regular'; $siteTagline = $home->summary; ?> <?php include("./header.php"); ?> I get the following when I look at the source code the following appears from line 34 onwards actually after a blank initial line and the sidebar content: <!DOCTYPE html> <html lang="en"> <head id='html-head'> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title id='html-title'><br /> <b>Fatal error</b>: Call to undefined function page() in <b>/[local path to site directory]/site/templates/header.php</b> on line <b>6</b><br /> <p style='background:crimson;color:white;padding:0.5em;font-family:sans-serif;'><b>Error: Call to undefined function page() (line 6 of [local path to site directory]/site/templates/header.php) </b><br /><br /><small>This error message was shown because: site is in debug mode. ($config-&gt;debug = true; =&gt; /site/config.php). Error has been logged. </small></p> I don't know if it makes any difference but the site-regular profile is being run with pw 3.0.61. That error refers to the following line in the header.php file, btw: <title id='html-title'><?=page()->title?></title> I've not had any issues with php include in the past. So this is a little frustrating. Any further thoughts would be appreciated. Thanks.
  5. Hi, I need to separate the header, footer and sidebar from the _main.php file. I've tried all of the following without success: <?php include ("header.php"); ?> <?php include ("/_header.php"); ?> <?php include ("./header.inc"); ?> <?php $header = pages()->get('/rcl-header.php'); // include header echo $header; ?> Any guidance would be appreciated.
  6. Thanks for your replies, tpr/Robin S. Having run a test taking PW3 and Uikit out of the equation, I realise now that MDBootstrap 4 was applying the following css code: box-sizing: inherit; so the original implementation displaying the circle as required was being constrained - by applying padding to the div equal to the width of the border. Even so the question as to whether or not it will be possible to use Processwire 3 with frameworks other than Uikit3 remains.
  7. Just a quick query regarding Processwire 3 and Uikit 3 integration. Is Uikit 3 going to be inextricably bound to Processwire 3? The reason I ask is that having developed a site style in earlier PW3 dev versions (now on 3.0.59) using Material Design Bootstrap 4 as requested I find that Uikit 3 is messing up independent css code used to display various design elements. There is no difference between the CSS code to produce the circle behind the logo and there is no indication why its being displayed as a round cornered square - see attachments. Is it at all possible to continue using MD Bootstrap 4 with the latest dev versions of Processwire 3 in corporating the site-regular profile? Any advice would be greatly appreciated.
  8. Amending the site/config.php file by inserting the following line of code immediately after the opening <?php appears to have resolved the issue: setlocale(LC_ALL, "en_GB.utf8"); Thanks for everyone's help.
  9. Update: Interestingly there was no warning message when I installed dev 3.0.59 locally in MAMP this morning but after I apparently successfully installed 3.0.59 in my cPanel-based hosting account the warning was displayed upon initial login to Processwire Admin again: I note that both the locally installed (MAMP) Processwire config.php file and cPanel-based hosting account Processwire config.php file display identical configurations: $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; $config->useMarkupRegions = true; $config->useFunctionsAPI = true; $config->dbCharset = 'utf8mb4'; $config->dbEngine = 'InnoDB'; ... $config->timezone = 'Europe/London'; If I simply add the following line of code to the top of the site/config.php file: setlocale(LC_ALL,'en_GB.UTF-8'); will that resolve the issue?
  10. Hi abdus, Current locale:\nstring(1) "C" \n\nAvailable locales:\nzu_ZA.utf8 Yes, that was the whole of the output. The long list shows the available locales that can presumably be set. I've no idea an apparently South African locale is only showing as available when there doesn't even seem to be any South African locale option available under View Available Locales in cPanel. It is very odd. Edit: I spotted the following under the cPanel Locales Documentation: Looks like php code does ot display the locale information correctly for cPanel/WHM users. Having downloaded the cPanel english (en) locale there doesn't appear to be anything included that should cause a problem for a UK localised installation of Processwire. Any ideas on how best to proceed.
  11. Thanks for the reply, abdus. I just managed to work out the issue and have got the file to run with the following code: <? php; echo '<pre>Current locale:\n'; var_dump(setlocale(LC_ALL, '0')); echo '\n\nAvailable locales:\n'; echo exec('locale -a'); That code then returned: I've not got multi-language support installed as it is not required. Is the locales setting referring to how the webhosting server is confiugured, the hosting account is configured or how the PW installation is configured? When I check the available locales in cPanel I get the following list: This shows there is no locale currently configured for GB. This issue has not occurred before and I haven't changed the locale settings. There was no issue following the original installation using PW 2.7.x. The only thing I can think of is that because I set Europe/London as part of the Processwire 3.0.58 installation and because there is no existing English GB locale the installation process has baulked. Any ideas on how best to proceed?
  12. Hi fbg13 / SamC, Apologies for not responding sooner and thank you for all your feedback. In the end I decided to go down the route of removing everything and re-installing the development branch v. 3.0.54 that allows the regular-master profile (incorporating a blog module by default that can be customised as News) referred to in Ryan's Introducing a new ProcessWire site profile and ProcessWire 3.0.54 and Uikit 3 admin theme blog posts. This greatly simplified the integration of a news section in my offline testing. I'm now in the process of removing everything, installing the development branch v. 3.0.58 (as this dev branch appears to be close to the stable version that is intended to be released) with the regular-master profile. The initial master site intallation went smoothly apart from a locale error/warning issue which I have detailed in the Warning about Server Locale after update from 3.0.52 > 3.0.53 - Help! forum topic and am hoping to to resolve. The issue I've found with the tutorials referred to is that they practically all deal with version 2.x or earlier of Processwire, btw. Many thanks again for your help.
  13. Just run into this problem following a reinstallation using the latest dev version 3.0.58. When I setup the testlocale.php file to check the current configuration: <?php echo "<pre>Current locale:\n" var_dump(setlocale(LC_ALL, '0')); echo "\n\nAvailable locales:\n"; echo exec('locale -a'); ?> and try to load the file in the browser I get the following error message: How do I go about resolving that? In addition, I am guessing the installation is picking up that the server is not located in the US but in the UK. So should the setlocale configuration in this case simply be as follows? setlocale(LC_ALL, "en_GB.utf8"); Another setting under section 2 of the config.php configures the timezone as: $config->timezone = 'America/New_York'; Does the setlocale instruction override that confguration or should that also be altered accordingly to: $config->timezone = 'Europe/London'; ? Any assistance would be appreciated.
  14. Hi, I just wanted to check whether or not the following topic is still valid with respect to PW 3.x: https://processwire.com/talk/topic/22-how-to-build-a-news-page/ I am trying to integrate a news section into a basic multisite PW website installation (voluntary project) intended for a community of two villages. Currently there are 4 subdomains (hca-site, hfi-site, hhg-site, hps-site) that link back to the main domain website (https://thehanneys.uk) by clicking on their home buttons. I had a look at the Blog (ProcessBlog & MarkupBlog) module but it is not really what I'm looking for - a simple News section. At the moment we're just concentrating on getting the functionality in place. The styling can come later. The first issue encountered is that there is no checkbox under the Advanced section for "Page Numbers" to turn them on for the news-index template. Secondly, I don't understand why the following text is being displayed above the navigation when I expected it to be displayed after the page title. Thirdly, are the story pages displayed on the index page simply by creating a new child under News (page based on news-index.php template)? Showing 0 of 0 Article(s) | Page 1 of 0 The current code for the news-index.php template is as follows: <?php namespace ProcessWire; // basic-page.php template file // See README.txt for more information // Primary content is the page's body copy $content = $page->body; // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if($page->hasChildren) { $content .= renderNav($page->children); } // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if($page->rootParent->hasChildren > 1) { $sidebar = renderNavTree($page->rootParent, 3) . $page->sidebar; } // start the news stories list echo "<ul>"; // get the stories for this page $stories = $page->children("limit=6, sort=-date"); // note if you set the stories to sort by date descending on the /news/ page // in the admin, then you can omit the "sort=-date" above. // cycle through each story and print it in a <li> foreach($stories as $story) { echo " <li><a href='{$story->url}'>{$story->title}</a> <p><strong>Date:</strong> {$story->date}</p> {$story->body} </li> "; } echo "</ul>"; // get values for our placemarker headline $start = $stories->getStart(); $end = $start + count($stories); $total = $stories->getTotal(); $num = $input->pageNum; $lastNum = ceil($total / $stories->getLimit()); // output the placemarker headline echo "<h5>Showing $start - $end of $total Article(s) | Page $num of $lastNum</h5>"; // output pagination links echo $stories->renderPager(); The current code for the news-story.php template is as follows: <?php namespace ProcessWire; // basic-page.php template file // See README.txt for more information // Primary content is the page's body copy echo "<div id='bodycopy'>"; $content = $page->body; echo "</div>"; // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if($page->hasChildren) { $content .= renderNav($page->children); } // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if($page->rootParent->hasChildren > 1) { $sidebar = renderNavTree($page->rootParent, 3) . $page->sidebar; } P.S. Are there any books/tutorials specifically covering PW 3.x? Any assistance would be greatly appreciated.
  15. Adding the following code: echo "<li><a href='http://www.example.com/'>Home</a></li>"; after: <!-- top navigation --> <ul class='topnav'><?php In the _head.php file and the _main.php files achieves the desired effect by directly editing the template files. Is there a way to achieve the same result from within processwire admin?
  16. I'm wondering if anyone else has attempted this before. I've setup a basic test multisite installation that effectively includes the master site and 3 others subsites using either the basic or intermediate template. I can't remember which and there might even be a mix of both among them, but I don't think that should cause an issue. What I want to achieve is a Home tab in the navigation menu on each of the subsites that links directly to the Home page of the master site. Is it possible to do that within the processwire admin or is it something that is going to have to be hardcoded into the template file. If the latter, do I go about that as I cannot see anything that appears to relate to the navigation in each of the site directories. i.e. Is it possible to add a menu item to the left of the subsite "Home" page now named About that is simply a link named "Home" that redirects to the Home page of the master website? Any thoughts would be greatly appreciated.
  17. @kondongo I am sorry for the delay in replying, I thought I'd raised a new topic (Evidently not! ) and therefore wasn't looking in the right place for any replies. Thank you for your very speedy reply and the links. I had an issue with links between the pages which I appear now to have resolved using: <a href="<?php echo $config->urls->root; ?>about"</a> All of those below returned blank pages: <a href="<?php echo $config->urls->templates; ?>about"</a> <a href="/about"</a> <a href="./about"</a> I'll read through the links you have provided and see how I get on. In the meantime I've tried working through the Simple News System guide so far without success. I'm not sure if this is an issue related to the installation path of this instance of PW (in this instance while the site is under development: http://localhost:8888/rcl_pw252/ ) or the fact that I changed the name of the templates, fields and pages. I'm pretty certain I've updated the news.php, news-index.php and inc/news-fnc.inc files have been updated correctly accordingly, but I still get blank pages being returned which might suggest that the inc/news-fnc.inc file needs to include paths in at least some instances as well. Any thoughts would be appreciated. Thanks again.
  18. Hi, I am just getting started with PW. I've successfully installed but not yet confirgured the ProcessBlog module and would like to know before I delve further whether or not a single instance of the module can be used to deliver multiple blogs. What I have in mind for the website I am currently working on is both a separate News section and a separate Testimonials section. Is it actually necessary to completely split the two sections/blogs in terms of the backend? If not, how should I go about setting this up? Can categories be set up to split the data for News and Testimonials? Effectively both pages could be built around the same underlying data structure, for example: $post-date-time ( - would like the date|time to appear as yyyymmdd - hh:mm:ss, though) - do I actually need this field or can this data be retrieved from a built-in PW source?? $post-title $post-summary $post-author $post-category ( - needed or not?) In addition, what are the advantages / disadvantages of the different blog styles? Purely from the path name perspective it appears that Blog style 3: /mysite/posts/example-post/ might be the most appropriate. Otherwise, would Joss's Simple News System be a better place to start? Any guidance would be greatly appreciated.
×
×
  • Create New...