Leaderboard
Popular Content
Showing content with the highest reputation on 02/12/2013 in all areas
-
Okay, the editor is back again so we can use the forums (hurrah!). Here's a quick update - I've had to hardcode a setting into a JS file to get it working, so looking through various things and the fact that there are still a few invisible errors behind the scenes I think there's something wrong that's taken hold during a past update and each update is making it slightly worse. As such, I'm going to pass it over to the devs to look into now to see if they can find the cause and sort it out. In the meantime, I don't think any of the other errors people have been reporting will have been fixed, but nor should they hopefully be any worse. In short, the core code is up to date and we're all secure, but the user experience is no different than before until I get to the bottom of this.3 points
-
$num = 10; // u.tell it how.manys file ob_start(); $path = rtrim(wire('config')->paths->files, '/'); passthru("find $path -type f -exec stat -f '%m %N %m' {} \; | sort -n | tail -$num | cut -f2- -d' '"); $data = explode("\n", trim(ob_get_contents())); ob_end_clean(); foreach($data as $line) { list($file, $ts) = explode(' ', $line); echo date('Y-m-d H:i:s', $ts) . " - $file<br />"; }3 points
-
Assuming I understand the need correctly, what I usually do add this to the <head> section of the main markup include: <head> <!-- all your typical <head> stuff --> <?php $file = "styles/$page->template.css"; if(is_file($config->paths->templates . $file)) { echo "<link rel='stylesheet' type='text/css' href='{$config->urls->templates}$file' />"; } $file = "scripts/$page->template.js"; if(is_file($config->paths->templates . $file)) { echo "<script src='{$config->urls->templates}$file'></script>"; } ?> </head> Using this method, if you have a template named 'product', then it could have dedicated CSS and JS files in /site/templates/styles/product.css and /site/templates/scripts/product.js, when you need it. The nice thing about this is that it's just a system rather than hard coded file. If you determine you need something unique for the CSS (or JS) on pages using some template, the you can just create the CSS (or JS) file and have it start working automatically. You can take this further too. For instance, you could use the same technique with page IDs to assign custom CSS/JS files to specific pages.2 points
-
My way of handle it was to create a textarea field and insert the code there directly. In the head.inc I had something like this: <?php if($page->additional_css != '') { echo '<style type="text/css">'.$page->additional_css.'</style>'; } ?> So no extra files were needed.2 points
-
Hi cristian and welcome to the forums. I don't think there is a guide for this. Depending on the scale and type(s) of content i think a migration from Evo to PW often is relatively simple. I have done 1 Evo to PW migration. This only consisted of a couple of hundred news pages in Evo. These pages had their own template and a couple of template variables attached to them. So what i've done is run a couple of sql queries via phpmyadmin to get the page data and it's associated template variable data. I then exported the stuff to a csv file. Then after some minor adjustments to the csv i imported it with this module: http://modules.processwire.com/modules/import-pages-csv/ Of course, before doing so, make sure you've set up the template(s) and fields you need in PW. This is a very simple example; if the data you wish to migrate is more complex and/or high volume you would have to make use of the excellent PW api to achieve this. If you could give some more details i'm sure there are people on this forum that can give you some further help.2 points
-
LanguageLocalizedURL module Localized URL generator and parser You can find the last version here: http://modules.proce...-localized-url/ Or from the repository on github: https://github.com/m...e-localized-URL This module is useful to generate localized url using the language code as first 'folder', and then the localized titles of the nested pages: (removed previous instructions to prevent double maintaining.) See more infos in readme of the module with instruction and informations. https://github.com/m...aster/README.md1 point
-
Unless you have not thousands of child pages in one branch I dont see much speed issues. Also theres options to add id to name which will allow even some more. Ive never used cacheing in pw and have some heavy sites I did not notice getting slow. Pw is fast and allows for scaling you might think it needs cache as with other systems.1 point
-
In this instance I think I'd want to use the same template file for all of the static files. With the exception of the additional JS/CSS to interact with the body content, everything else would be the same - though I do like that way of doing things. Ryan, when you mention using the same technique with page IDs, you mean PW page IDs and not a body element property "id" value right? If so, at that point I think Nico's solution might be more versatile in that it can take advantage of other features, such as the "copy page" module, unless I'm just not understanding something. Thank you both very much for your input though! I was leaning toward's Nico's way of doing it for this project, but just wasn't sure if it was the right way of doing this type of thing. There isn't always a right or wrong, but oftentimes there's a "best" - whether that's this or not, it's time to stop over-thinking and move forward. Thank you again!1 point
-
@alanfluff: It must have been because of the version number - I had forgotten to update it in the source. It should be fine now, just pushed the update to GitHub. Sorry! I hope the actual updates are in place though .1 point
-
I will post it here hoping that it is my mistake and it shouldn't be reported as PW issue. I have pages with field "event_datetime" with value similar to: 2013-02-09 19:00 2013-02-10 11:00 2013-02-12 19:00 2013-02-14 19:00 2013-02-15 19:00 2013-02-16 11:00 and code $today = "2013-02-11 21:34"; $rows = $events->find("event_datetime>=$today, limit=3"); in PW2.2.x echo count($rows) will output: 3 in PW2.3 count($rows) is 0 Is it related to the new changes in the Selectors or I have to use another way to do it properly? Thanks in advance.1 point
-
nginx doesnt have support to .htaccess files and all of the rewrite rules are stored in (virtual) host config updated manually. The apache rewrite rules have different syntax so they should to be converted to nginx style. I will send my version of the nginx rewrite rules by email. I believe that it will be easy to implement that ProCache will suggest the necessary rewrite riles for nginx too. Just a suggestion.1 point
-
Thanks again nik for this Module I've just gone to update to 1.1.1 from 1.1.0 but it seems like the download (via git or via Modules Manager) always gets 1.1.0 and so Modules Manger keeps reporting that there is a 'new version available'. Or is this something silly I am doing?1 point
-
Soma, once we've got 2.3 as the current stable version out there, I'll go through the cheatsheet and figure out what needs to be added, etc.1 point
-
Looks like the University of Oregon cheerleaders/dance team have made excellent use of the Blog profile: http://uodance.com/1 point
-
WillyC's example actually works. Returns the 10 last updated files. But the shell commands it executes are pretty unix specific (though am guessing there is an equivalent in Windows). We might be able to just add a timestamp field to the file-based fieldtypes too. I kind of hate to duplicate info like that, but the reality is that disk space is cheap and making them queryable from the PW API would be nice.1 point
-
Hi Pete, Thanks, I have suggested that to my boss - he refuses to move (despite the numerous BT-related issues we regularly have to deal with). At the end of last week I wrote up the whole problem and expressed my disappointment (polite phrasing )with the BT Broadband people in a 2.5 page letter to the Chairman's office. It is now being looked into by the proper IT people at BT and, more importantly, one who was willing to see the problem by connecting remotely to my PC whilst also running our site on his own PC and realising that the problem is indeed completely localised to our connection (finally!). I will report back on here for good order when (if?!) they have fixed it, so at least if this happens to someone else, this post will possibly help to point them in the right direction!1 point
-
Asked him, why to give up. If he give up, I will give him not much change other software wil run smoothly.1 point
-
I'm able to reproduce that error message, but only with a broken config. If $config-variable is an object but $config->dbHost evaluates to false, I'm facing the same message (this piece of code here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Database.php#L62). It's a Config-object represented as a string --> 'Config'. @sbarner: So, are you certain you've got exactly this in your config? It's case-sensitive ("dbHost" I mean). $config->dbHost = 'localhost'; And there's nothing else affecting $config->dbHost after that? One possibility would be an if-clause with assignment instead of comparison, something like this: // this would break things up! if($config->dbHost = '') { // do something different for one environment, or whatever }1 point
-
1 point
-
Texformatter modules aren't autoload they only get called when needed. You'd have to make it autoload to use the init in the backend, but then it's not when it's called but when autoloaded in the admin. Then you could use init to add a hook InputfieldText::render there for fields that use that this textformatter.1 point
-
Maybe a useful addition: $sanitizer->entities() Cheers Btw the cheatsheet is the best API overview/explanation ever seen! Thanks for making this.1 point
-
Looking forward to learning a lot of great lessons from this; thank you SO much for sharing Ryan!1 point
-
Upgraded from 2.2.9 to 2.3-dev without any problems! Specs: Apache 2.0 PHP 5.3.16 MySQL 5.0.951 point
-
Look's like this bug has been fixed only partially. Using the examples from my opening post, this selector works now as expected (giving pages c3 and c4): $pages->find("template=company, tags.title!=t1"); But if page id is being used, the old bug remains. Given that tag page t1 has id 1234, this still returns pages c2 and c3: $pages->find("template=company, tags!=1234"); And this is dev branch I'm using here.1 point
-
1 point
-
Feb 8, 2013 Announcement Page with download link MAMP & MAMP PRO 2.1.2 PHP versions updated MySQL version updated Apache version updated phpMyAdmin version updated Programs and libraries: Apache HTTP Server 2.2.23 PHP 5.1.6, PHP 5.2.17, PHP 5.3.5, PHP 5.3.6, PHP 5.3.14, PHP 5.1.20, PHP 5.4.4, PHP 5.4.10 MySQL 5.5.29 phpMyAdmin 3.5.5 SQLiteManager 1.2.4 Alternative PHP Cache (APC) 3.1.9 curl 7.24.0 eAccelerator 0.9.6.1 Expat XML Parser 2.0.1 FreeType 2.4.8 gettext 0.18.1.1 jpeg 8d libiconv 1.14 Libidn 1.17 libmcrypt 2.6.8 libpng 1.5.7 libxml2 2.7.8 libxslt 1.1.26 Sablotron XML processor 1.0.3 t1lib 5.1.2 XCache 1.2.2 XCache 1.3.2 Xdebug 2.2.0 PHP/YAZ 1.0.14 YAZ 4.0.11 point
-
look into a good xml editor, i think even notepad+ has syntax highliting and validation. http://www.xml-editor.info1 point
-
Installed fresh 2.3 copy and everything went fine. Spec: Windows 7, IIS 7.5 running PHP 5.4.6 with MySQL 5.5.27.1 point
-
<disclosure>I used to sell Encyclopaedia Britannica.</disclosure>1 point
-
Is it that shelf with lots of books that look all the same in my parents house?1 point
-
1 point
-
1 point
-
This is how you could do a portfolio site using Smarty Templating: First, build a structure like this: Projects (template: projects) - Project 1 (template: project) - Project 2 - Project 3 Tags (hidden, no template) - Tag 1 - Tag 2 - Tag 3 Second, for each project page add fields: - title - description - tags (type: page) - date - images Third, create the Smarty template file projects.php in your /site/templates, similar to this: {include './head.inc'} <h1>{$page->title}</h1> {* title of the Projects site *} {foreach $page->children as $child} {* we are looping through projects *} <div class="project"> <ul class="slider"> {foreach $child->images as $image} {* now we are looping through project images *} <li><img src="{$image->url}" alt="{$image->description}" /></li> {/foreach} </ul> <div class="rightside"> <h2><a href="{$child->url}">{$child->title}</a></h2> {* project title *} <p>{$child->description}</p> {* project description *} <p>Filled under: {foreach $child->tags as $tag} {* now we are looping through project tags *} <a href="{$tag->url}">{$tag->title}</a> {/foreach} </p> <p>Project added on: {$child->date|date_format:"%D"}</p> {* project date *} </div> {/foreach} {include './foot.inc'} Fourth, create the Smarty template file project.php with this content: {include './head.inc'} <h1>{$page->title}</h1> {* project title *} <ul class="slider"> {foreach $page->images as $image} {* now we are looping through project images *} <li><img src="{$image->url}" alt="{$image->description}" /></li> {/foreach} </ul> <p>{$page->description}</p> {* project description *} <p>Filled under: {foreach $page->tags as $tag} {* now we are looping through project tags *} <a href="{$tag->url}">{$tag->title}</a> {/foreach} </p> <p>Project added on: {$page->date|date_format:"%D"}</p> {* project date *} {include './foot.inc'} The rest is some JavaScript for sliders (e.g. Nivo slider) and a bit of CSS. (Disclaimer: I have not tested this code on a live server, writing from my mind)1 point
-
Just tested this with a test installation which basically runs the Skyscrapers profile. (I use it for playing around with admin themes a little.) Upgrade from 2.2.9 to 2.3-dev running on Apache 2.2 and PHP 5.3.17. No issues.1 point
-
I'm late to the party, but I've used SimpleXML before as well for reasonably large files ryan - only 2-5mb in my case though and a looong time ago. P.S. I'm brave and have Windows 8 Phone and Desktop. So far the world hasn't ended1 point
-
While I agree that there are differences between editors (I have found using a latest CKeditor a pleasant surprising), I don't think that settling with another editor will solve the fundamental problems. If we use just the basic features (text formatting, links) the tinyMce is just find. Replacing it with something that does those things only doesn't solve the problem, it just takes away features that someone might need in some projects. What I would like to see this discussion going is what kind of problems and solutions we have. In our projects we usually get away with very few tinyMce buttons (the more buttons, the more problems) - but the real pain points for us are: 1) image placement 2) tables (I think this is one area where CKeditor is much better - also area that many smaller editors just skip, or have very poor implementation like Aloha) For 1) problem there are sometimes nice solutions, like just using predefined image placements on template. I know that is something that Ryan uses a lot (like here: http://www.villarental.com/villas/17-the-harbour/). It works great when working with clear template (like "villa" here), but it fails when site has a lots of general content pages. What our old cms did and what newsletter editors seems to do now (like http://mailchimp.com/) is to have "mini templates" or "blocks" that keep the structure, instead of just having images and text mixed. That is nice way to do it - editors doesn't have to think about image sizes (that is pain currently), it is easy and safe on redesigns (image sizes are relational to column width) etc. For 2) problem sometimes repeaters can be used, sometimes textarea with text formatters and sometimes just good rte (ckeditor > tinymce in this regard) Very interested to hear what kind of problems people are having currently and what kind of solutions might help?1 point
-
Haven't used any of them - more a case of just throwing them out there. I'm starting restarting a biggish project very soon and have been looking for a starting point for the site. My design skills are woeful, so any way I can draw on work others have done is a major help.1 point
-
Sounds good, I am putting this in 2.3 and should be on the dev branch later today. It will look for a file /site/templates/errors/500.html and use it when present.1 point
-
There's different approaches to how it can be archived. I'm building a shop with products with multiple categories possible. I'll quickly show how it's done. Create template "category" only with a title field. Then build a tree structure that will be hierachical and serve as the navigation. The template need to have urlsegments enabled. That will enable to display products under a category. So the url will be something like /shop/category1/product1/ and in another category the same product /shop/category2/product1/. This will make it easy to have a highlighted navigation. The product template will have fields you need and create them under one separate tree. In that template you add a page reference field "categories" that has set the categories tree parent as parent, and a multiple select to browse and select them. Then this following php code will handle the navigation and rendering of the products. This is in the template for the category template. $prod = null; $nav = $modules->get("MarkupSimpleNavigation"); /* * * If on shop category pages * All category pages use "shop" template * "shop" template has url segments and page numbers enabled * So urlSegment is always the first (1) when browsing the categories * Once the page is of type "product" we use that information to output details * * This most easy setup with navigation and categries nested unlimited * and multiple categories per products * */ if($input->urlSegment1){ // the page is a product? if($pages->get("name=$input->urlSegment1")->template == "product"){ $prod = $pages->get("name=$input->urlSegment1"); $current = $page; } else { // else we get current page $current = $pages->get("name=$input->urlSegment1"); } } else{ // in case we are on a "normal" page, do different stuff $current = $page; } $root = $page->rootParent(); echo "<div style='float:left;width:30%'>"; echo $nav->render(null,$current,$root); echo "</div>"; echo "<div style='float:left;width:68%;margin-left:2%'>"; // detail page if($prod){ echo "<h2>$prod->title</h2>"; echo "<p>$prod->body</p>"; } else { // list page $prods = $pages->find("template=product, categories=$current, sort=title"); foreach($prods as $p){ echo "<p><a href='$page->url$p->name'>$p->title</a></p>"; } } echo "</div>"; There's variations how this can be setup, but this gives a very easy and flexible setup, with a navigation that is highlighted and can have multiple categories for one product.1 point
-
1 point