-
Posts
526 -
Joined
-
Last visited
Everything posted by Gazley
-
That's pretty much the conclusion I ended up at but it still seems odd that you can't. Shame. Thanks everyone for participating in this discussion.
-
Hi teppo, You'll have to believe me on this $outVal contains the embedded <?=$pages->get('/smart-devices/')->url?> between the quotations in the link's href. I'm not actually echoing out the whole string. The string is ultimately being built up and specified against a $page variable called $page->outVal - in my layout file that is part of the final include'd master "main.php" file, $page->outVal is referenced there. I guess I assumed that it would "eval" any PHP content but it doesn't seem to do that. This means that I would actually have to specify the actual URL in the href.
-
$partial->set('text_area', $outBody) is a line in a method, not a template file, so I echoed out the value: string '<h1>GXflow™ Lets you Model, Automate, Manage & Optimize Business Processes in <em>any</em> Company!</h1> <p class="lead">GXflow is a tool that allows modeling, automating, managing and optimizing the business processes in a company for the creation of mission-critical applications in a simple and effective way.</p> <div class="gxp-kf well wb mb-40"> <h2>Key Features For GXflow™</h2> <div class="features"> <div> <div class="one_col"> '... (length=3954)
-
Hi teppo - the markup that I've suggested is part of the variable is actually content from a number of fields on a page that are merged together into a partial file. The markup string is built up and then set() into a property in a TemplateFile based on the partial. I then call render() on the TemplateFile instance. Does that make sense?
-
Hi diogo - I'm using PHP 5.4 so I think they're the default. Anyway, I had tried regular tags with the same result.
-
Hi there, I think I'm going a bit crazy! I have a string value like the following: <p><a href="<?=$pages->get('/smart-devices/')->url?>">Mobile Application Development</a> for Android, BlackBerry and iOS. Auto-generate native code without any user knowledge required</p> This value is part of the value in $outBody (see following) I set as a template value like so: $partial = new TemplateFile(wire('config')->paths->templates . 'partials/text_area.inc'); $partial->set('text_area', $outBody); $pages = wire('pages'); $page->outBody = $partial->render(); The actual last line of the real template file says: include("{$config->paths->templates}main.php"); The main.php file includes a layout file that says: <?= $page->outHeader ?> <section class="<?= $page->sectionClass ?>"> <? $class_name = 'static'; if ($page->static_page !== 1) { echo $page->list_items; $class_name = 'content'; } ?> <div class="<?=$class_name?>"> <?= $page->outBody ? $page->outBody : $page->body ?> </div> </section> <?= $page->footerBand ?> You can see that it directly references the $page->outBody variable. The problem is that in main.php, the href of the link specified at the start resolves to <?=$pages->get('/smart-devices/')->url?> and not the actual URL! What am I doing wrong here? It seems that PHP is just not evaluating the expression despite the PHP on/off directives that wrap it. Any suggestions to stop me going more crazy! Thanks --Gary
-
TemplateFile - how to create without existing disk file
Gazley replied to Gazley's topic in API & Templates
Thanks Wanze - that's a nice suggestion. -
Hi there, I have a "partial" based system where I have a class name (some_partial.php) and an associated ".html" file (some_partial.inc). If the class exists as a "partial", when rendered, it creates a TemplateFile using the path to its associated .html file. I've now a scenario where there are advantages to have the data that was in the .html file actually stored in a PW "page" (/partials/some_partial). When the partial instantiates, if it can't find a disk based .html file, it checks to see if there is a PW "page based partial". The HTML is in the page's body field. However, TemplateFile wants a file path to construct an instance. Is there a way to get a TemplateFile instance using the html data in my $page->body memory variable? Thanks.
-
Meta descriptions and selecting the first 'n' characters
Gazley replied to Gazley's topic in General Support
Thanks Soma - some interesting stuff there and definately along the lines I was looking for. -
Hi there, I just wondered what other users are doing in the following scenario. I use the summary field to contain hold text that I use as the meta description in search engines. If the field is empty, I would like to select the first 'n' characters of the body field so that at least something is being used for the meta description. There are numerous ways to do this in PHP. I recall that ExpressionEngine had a first party add-on that did something similar to this and also added '...' to the end of the string too, so that you could use existing copy as a summary in other places, like, the home page. Before I re-invent the wheel, I thought I would ask whether there is a standard PW approach or some handy-dandy class you could recommend? Thanks! --Gary
-
OK, thanks Ryan.
-
Hey, no worries on this one, I figured it out. It was a namespace issue that was causing the confusion. Cheers ...
- 1 reply
-
- 1
-
Hi there, I've tried to spl_autoload_register a class in my head.inc file. However, PW's "ProcessWireClassLoader" jumps in and looks for my class in the wrong place. I just want my own handler to be invoked, not PW's. Any ideas? Ta. --G
-
Hi there, I've just started using ACE and when I drop an image onto the editor surface, it registers the image in the images field but there is no image path specified on the editor surface, as shown in the video. I'm using latest PW and ACE. Any tips or advice around how to get the images path specified in ACE would be great! Cheers.
-
Thanks a lot for the replies! They really helped Cheers.
-
Hey guys, It's been a while! Any rules of thumb as to exactly what are the minimum directories that need to be made open in robots.txt so that search engines can crawl only what they need to see? By this, I mean all published pages and the images they contain. As PW is based on the front-controller pattern, I assume that pages can be reached via access to index.php in the root folder. I'd be interested in your thoughts/experiences. Cheers!
-
Thanks Ryan. Been a while since I've visited the site and boy, it's changed a lot with lots of new faces. I think you've created a monster! (a nice monster though)
-
Hi there, I've just installed apeisa's ProcessRedirects module and I have a few questions around it. I've inserted a bunch of URLs that are similar to the following: http://www.iconicboudoir.co.uk/?contact-iconic-boudoir/, http://www.iconicboudoir.co.uk/contact/ http://www.iconicboudoir.co.uk/#/contact-iconic-boudoir/, http://www.iconicboudoir.co.uk/contact/ in the above case, the "Redirects from" takes the following form: /http://www.iconicboudoir.co.uk/?contact-iconic-boudoir/ /http://www.iconicboudoir.co.uk/#/contact-iconic-boudoir/ IOW, the slash is added in front of the URL. I'm assuming therefore that we don't need the domain to be specified, just the path. However, if I specify the path(s) of: /?contact-iconic-boudoir/ /#/contact-iconic-boudoir/ The module complains: redirect_from: Error found - please check that it is a valid URL The original URLs are from a dynamic Ajax based site. The form /#/ is how the system itself defines its URLs but Google sees them as /? hence why they are specified twice, depending on what has been linked to. Any ideas around this or am I better off using .htaccess or seeing if I can modify the plugin? Many thanks!
-
Some nice stuff in there Ryan. Particularly excited to be able to tag and query images by tag. On this point, can you specify more than a single tag in a query? I often need to pull back images based on more than one tag. Thanks for all your efforts!
-
Wow! Some absolutely brilliant recommendations. Thank you all so much! Cheers!
-
Hi there, Any suggestions for a touch aware photo gallery? I used Fancybox on the site I have just installed remotely. When I tried the site on an iPhone and iPad, Fancybox doesn't appear to respond to touch, in place of a mouse click, when you touch its previous/next buttons or on the left or right half of the image. If anyone has any suggestions for a really good mouse/touch aware gallery utility, I'd appreciate your recommendations. Many thanks.
-
@adamkiss - thanks for being happy for me! Yeah, it can be a bit hairy when these things happen and it's nice to know that you have the support of a great team of fellow users to help or just empathise with you. It's great to know you're not alone; a position I've been in the past on many occasions. Cheers!
-
Problem solved - hurray !!!! I opened up the local Modules.* cache files in my IDE. One of them listed the following: _FormBuilder/FormBuilder.module _FormBuilder/ProcessFormBuilder.module FieldtypeCropImage.module FormBuilder/FormBuilder.module FormBuilder/ProcessFormBuilder.module GazleyHelperModule.module Helloworld.module InputfieldCropImage/InputfieldCropImage.module PageLinkAbstractor.module ProcessCropImage/ProcessCropImage.module ProcessExportProfile/ProcessExportProfile.module TextformatterResponsiveImages.module I can't believe it. The last time I updated FormBuilder to the latest version, I renamed the original one with an underscore, so, _FormBuilder. This is a habit of mine. Whenever I replace files, I tend to rename the original with an underscore so I can easily go back to it, if I need to. PW was processing FormBuilder twice! It also choked with the Paginator module that I replaced ages ago with my own version containing some changes that are in the Dev branch. I don't know whether Ryan's changed something recently but I haven't seen any problem with PW inadvertently processing underscore prefixed files until now? Any way, I'm in business! I went to the remote server and deleted the _FormBuilder folder and the site fired up instantly. It seems that the DB problem was a bit of a red-herring. I'm so pleased! Thanks to everyone who has offered me advice, tips and support. I really appreciate you guys! Thanks!!!!
-
So, I downloaded ProcessExportProfile as per apeisa's suggestion. I added it in the modules folder, went into my Admin panel and ran the option to load new modules. To my complete surprise, I got the same error as on the server: 2012-11-14 22:05:43 ? http://localhost:8888/?/ Compile Error Cannot redeclare class FormBuilder (line 22 of /Applications/MAMP/htdocs/ProcessWire/site/modules/FormBuilder/FormBuilder.module) So, it seems something is happening locally that is being transmitted to the server. However, this is the first time it has happened and trying to install the module seems to have triggered the problem locally. What's more, I can't even run the application locally without getting the same error. Wow.
-
Hi there, I cleared the cache down. I dropped the DB and restored it from my fresh local backup. When I tried an load the site, I get the same error as before: Cannot redeclare class FormBuilder ... I'm stumped. Ideas? Thanks.