Leaderboard
Popular Content
Showing content with the highest reputation on 01/04/2013 in all areas
-
A very simple tip, but that might be useful for someone that didn't think of it... This is what I usually do if I want to change something on a live site. if($user->name!='diogo'){ // live code }else{ // my new code } Like this I'm the only one that sees the changes. More examples: // test new javascript. do the same for styles <?php if ($user->name!='diogo'){?> <script src="<?php echo $config->urls->templates?>scripts/main.js"></script> <?php }else{?> <script src="<?php echo $config->urls->templates?>scripts/main-dev.js"></script> <?php }?> // test new head file if($user->name!='diogo'){ include(head.inc); }else{ include(head-dev.inc): } and so on... edit: corrected the first block by Nik's suggestion6 points
-
http://aneventapart....daptive-content Long - just over an hour, but fascinating video presentation from An Event Apart. But much of it could be a description of why to use ProcessWire (although it's not about PW). Much of the presentation will resonate with PW users.4 points
-
I'm a Toronto-based web designer and developer. Tinacious Design is my ProcessWire-powered website and it includes my web design and development portfolio and information about my services. See the website here: TinaciousDesign.com The back-end uses a modified version of the Moderna admin theme. I also posted a video on Vimeo showing the behind-the-scenes process of adding a new portfolio item.4 points
-
ProcessDateArchiver ProcessWire Date Archiver Process Automatically archives pages based on a Datetime field (e.g. /news/2013/01/03/some-news-item/). Behavior - When you add a page with a specified template, the module will automatically create year/month/day archives for it. - When you change the date in a specified Datetime field, the page is automatically moved to the correct year/month/day archive. - When moving or trashing a page, the module will automatically clean up empty year, month and day archives. How to create an archiving rule 1. Go to the Setup -> Date Archiver screen in the ProcessWire admin. 2. Click on Add New Archiving Rule. 3. Specify the template that should be archived (typically the news-item template). 4. Specify the Datetime field that should be used to determine the date to archive by. 5. Specify the template that should be used for creating year archives. 6. Optionally specify the template that should be used for creating month archives. 7. Optionally specify the template that should be used for creating day archives. 8. Click Add Rule. Tips and tricks - Configure the archive templates that will contain other archives to sort its children by name. - Configure the archive template that will contain the news items to sort its children by the specified Datetime field. - You will improve usability if you dont allow the user to create date archives manually. How to Install 1. Install the module by placing ProcessDateArchiver.module in /site/modules/. 2. Check for new modules on the Modules screen in the ProcessWire admin. 3. Click Install for the Date Archiver Process. Module download: https://github.com/u...hive/master.zip Module project: https://github.com/u...ssDateArchiver/3 points
-
Sorry, I just have to point this out: don't you have the blocks here the wrong way around? Everyone probably gets the point and corrects this automatically though - as you did with the latter examples yourself . Unless they just copy and paste the first snippet and go from there...2 points
-
ah sorry, try this: <ul class="nav nav-tabs" id="myTab"> <?php foreach ($page->children as $item){ echo "<li> <a href='{$item->name}' data-toggle='tab'> {$item->title} </a></li>"; }?> </ul> <div class="tab-content"> <?php $i = 1; foreach ($page->children as $item){ $activeClass = ''; if ($i === 1) $activeClass = 'active'; echo "<div class='tab-pane $activeClass' id='{$item->name}'>{$item->body}</div>"; $i++; } ?> Edit: Damn Diogo Edit2: Diogo I prefer the non PW way in the getting started forums. Makes code more comprehensible for a PHP novice.2 points
-
Hello again vanni, I think many of the TxP folks who have migrated over to PW have been in the same position. Take Tom Reno (renobird) for example; he's become very capable with PHP thanks to having to learn PW templates in a short period of time. There are good resources to help with this; template documentation on the main site, clear code examples on the forum (just browse for a while or google for them), an amazing blog profile for PW with lots of templates to use, an IRC channel and tools like Soma's cool API cheat sheet. Whilst TxP's parsed template tags are easy to use if you are used to writing X/HTML documents, you often have to spend time digging into the tag or plugin documentation to find out which attribute does what. With PHP you will have to learn some new things too, but once you know them you will have additional flexibility for your template handlers that isn't available without custom coding stuff in TxP and you will have a transferable skill which you won't have if you are putting time into learning TxPs unique tags. In addition, using PHP as the template language means the templates don't need to go through an additional parser.2 points
-
Hey all, I think it would be nice if the MarkupCache module could automatically expire specific caches when specific templates or pages are saved. This would allow us to cache heavy parts of a page for a very long time (or forever), and it'll only need to re-create the heavy part if its content has changed. It would also make sure no out-of-date content is shown. Advantages over the normal page cache are: - The normal page cache needs to re-render the whole page, this only needs to re-render the part that has changed (performance). - The normal page cache does not work with CSRF forms. I've coded a little proof-of-concept and I would like to hear if you guys have any suggestions or improvements. It works as following: Say you want to cache a news slider on the homepage: <?php if ( ! $data = $cache->get("HomeNewsSlider", 604800)) { // ... generate markup which uses the news-item template in $data ... $cache->save($data); } echo $data; ?> Then u would somehow configure the MarkupCache to expire the "HomeNewsSlider" cache when a page has been saved with the "news-item" template: This is how I have implemented it at the moment, but maybe someone has a better idea? I've also added a more convenient method (the begin() and end() methods) for caching markup: <?php if ($cache->begin("HomeNewsSlider", 604800)): ?> <h1><?=$page->title?></h1> // ... some other markup ... <?php $cache->end(); endif; ?> The module will start buffering the output when calling begin() and it'll save the buffer to the cache when calling end(). If the cache is available the begin() method will output the cached data. This way you wouldn't need to render all output to a $data variable. Hope u guys have some feedback or other/better ideas MarkupCache.module1 point
-
Erika needed a simple website to showcase the books that she designed. I think this is as simple as a book showcase can get http://diplom.erikagrafika.com/ There are lots of transparent PNGs to be shown at the same time (transparency because of the shadows and cut corners), to make them smaller I found an amazing tool http://pngquant.org/. No kidding, this tools can cut the size of a "saved for web" transparent PNG to half. I love how you can use it in a bunch of directories at the same time from the terminal, but if you only need it for a few pictures and don't want to mess around with the terminal, this online tool uses exactly the same process http://tinypng.org/. edit: I must have messed up the title, can someone entitled change it to "diplom.erikagrafika.com"?1 point
-
Hi Everybody, I'm a newbie to PW, but since the few weeks i'm working with it I like it a lot (mainly for it's flexibility). Ryan and others, you are doing a really impressive job. Congratulations! For a little CMS i'm working on, I want to use PHP script inside CCS stylesheet. For that, I put <?php header('Content-type: text/css');?> at the beginning of the mucss.css file which is renamed mycss.php, and I put the <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>mycss.php" /> in the header of a template file (mycss.php is in the same directory as my templates). But this code doesn´t work, the mycss.php file is not rendered in the final html page. After a few testes, I got my objective with this code instead <link rel="stylesheet" type="text/css" href="/mycss.php" /> and putting the mycss.php file in the root directory of website. This change of directory is not very suitable for when I want to export my site profile for new installations. Any idea what is wrong or what can be done for doing the trick maintaining the original structure of PW. Thanks.1 point
-
Have u ever worked with Wordpress? Try to implement custom fields, I bet u will end up crying like a little girl1 point
-
ProcessWire will have support contract options available in 2013. I'm still working out the details, but wanted to let you know that option will be there for those that want it. Most of us here don't and won't need support contracts, because we can get pretty much anything resolved in a manner of minutes via these forums. But I would gather that a large portion of PW's user base doesn't actually participate in these forums. I also think that there are companies out there that would feel much better having the insurance of guaranteed support when they need it. Basically, if someone feels they need a support contract, I want to make sure we can accommodate that. I also see this as a way to further support growth of the project. As for EllisLab, I think they may be in a tough spot and trying to find the best way to survive and hopefully thrive. I had heard unsubstantiated rumors on Twitter several months ago that they might make EE free. To me suggested they might not be thriving as a business the way I would have thought. In such a case, change could be necessary in order to grow rather than contract. I have no idea if this is true (it's all guessing), and it's a little hard for me to imagine how they could not be profitable… given that their entire user base pays to use the software. But I don't think they would have made such drastic changes if everything was okay with the business model and finances before. My guess is they were faced with the choice of having to make cutbacks (like staff), stagnate, or make big changes. It appears they opted for big changes and are trying to re-focus their resources towards the high-end. That being the 20% of the audience that can pay the big bucks, at the expense of the other 80% that doesn't pay as well. And have probably accepted the sacrifices that go along with it. For that 20%, these costs are not really that big, and are probably seen to strengthen the B2B commitment (greater cost sometimes feels like greater insurance and less risk). There are other big players out there paying hundreds of thousands of dollars (every year) to companies with products that are inferior to EE. There are more opportunities to grow for them there than there are on the open source side. After all, products like ProcessWire and others are just as capable (and many would say more-so). It's not sustainable and makes little sense in a for-profit business to plan growth competing against a worldwide network of developers working for free. It's hard to grow a business when most of your competition is at least as good, and free. Whereas, I think it makes good business sense for them to carve out some new space where there is opportunity and partnership with bigger players. That's the side where the service matters as much, or more, than the software itself. And they can do well at both. I'm hoping that ProcessWire and other open source CMSs can benefit and grow as a result of changes with EllisLab. But I also hope that EllisLab and ExpressionEngine benefit and grow in the way they want to. Looking at where they are and what they are, it's not hard to understand why they've refocused. Though I say that as an outsider that's not negatively affected by their decision. Regardless of whether you like EE or not, it is in a fairly unique spot in the CMS landscape as a commercial product that is often listed with, and interchanged with, open source products. It's not something that I think could be repeated today, and I've always had a lot of respect for what they've been able to do and the influence they've had. EE is a good software with good people behind it. I'd like to see them do well and think that they will.1 point
-
Thanks for adding to the modules directory. I have updated your listing with some additional text description and your screenshots. Feel free to change if you'd like: http://modules.processwire.com/modules/delegate-profile/1 point
-
That's a good thought. I made the same test on a different pw website using a different host and it seems to work. I don't know why it won't on this one but when all other options are run out then the only thing left is the host. I doubt I'll get anywhere with them since they already told me it won't work so short term I deleted the image that was being hotlinked and long term I may look at new hosts. Thanks Joss and Soma for tackling this with me.1 point
-
Pete, you can replace your find()->count() lines with just count(), which would be a little more efficient, i.e. $count += wire('pages')->count("authors=" . $u . ", include=all");1 point
-
If you put the Rules right after the "RewriteEngine on", there's nothing else that would make it not work and PW rules afterwards won't get executed at all obviously. I can't think of anything why it shouldn't work. Maybe something on your host is configured differently. Could it be that files with two "." in the filename are a problem for you?1 point
-
Thnx for the comments and tips guys! I've pushed some new changes: - Moved Site button from navigation to user actions. - Moving search bar to the left on mobile devices. - Changed PageList font-size to 12px for better readability. - Fixed translation issues. - Made PageListStatusHidden class a bit darker for better readability. - Removed automatic Javascript resize of title.1 point
-
Greetings diogo, Excellent idea. This got me thinking... It seems the concept could be expanded systamatically. I'm still working it out, but I'm imagining a system that detects development/testing elements. Maybe a way to tag certain CSS classes/IDs and place development JQuery plugins inside a specified folder? Then you could have a ProcessWire conditional that checks to see if certain CSS is present, or if there are any JQuery plugins inside that specified folder. If yes, the developer elements would happen; if no, then the "regular" site elements happen. I like this! Thanks, Matthew1 point
-
I understand perfectly but I think it's nice to present both1 point
-
a Andre just remembered a css star hover tut. check this: http://css-tricks.com/star-ratings/1 point
-
Thanks for the comments all and thanks for taking the highroad and opting not to bash me out of existence for asking the (for other providers, anyway) hard questions. I agree with the support being offered by EE to be subpar; which is why I am strongly looking at PW. I'm sure you guys will find me on these forums more often1 point
-
This may be a directory problem - in other words it is only working in the root directory, it needs to override all?1 point
-
Hi Axis, glad you are enjoying PW. You can't access the templates directory by url, since it's protected by the htaccess file. What you can do, is create a css page in the tree with your css.php file as it's template and access that page url instead. wrote on mobile... can be clumsy edit: not on mobile anymore, you can see more about my answer here http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/#entry206411 point
-
I think that people spend entirely too much energy on optimizing URLs. It almost doesn't matter, after all - I feel that there is virtually no chance somebody will enter the URL manually (except the index page, maybe). My opinion is that multiple hierarchies = bad. Simple as that. But you have valid use-cases (or problems), so I can try to give you my opinion. [simpler URLs (for blogposts)] I see two options here: I'd either code the root page as a router of sorts (with rules given in case of collision), or didn't simplify the URL up to the root: domain/articles/this-is-article, or domain/topic/this-is-article, or even domain/a/this-is-article would work for me; I'd probably go with articles, because it's most logical - therefore articles will be both article router AND content holder. [simple URLs (eshops)] This is practically the same situtation [Different menus] If somebody wants to build menus manually (and I doubt that), then PW probably might not be ideal tool, but having some 'Custom-menu' tools page seems like a good solution here. And if you want your menus automatic, then I see no problem having millions of menus: if the menu is automatic, there must be a way to describe which content goes there, and then it's a simple problem of coming up with the right query. [Example: catalog] This is precisely the thing I'd build with one catalog and two router pages with using URL segments on (or, if it was simpler, just one 'router' page, and the other industry would have the 'real' tree), and possibly on module for generating the menus (again, there must be a way to tell the computer how you want the tree to be created and/or modified) Generally speaking, I think it's less about the hierarchy and more about the context; and there are almost always ways to give user more context other than multiple hierarchies. --- Edit: Reading through Antti's link, it seems that I echo Antti's and Ryan's opinion1 point
-
After i now found "requireSecurityField" in the form settings of the Comments Module and searched how to implement this, i found this thread: I guess this will be a sufficient alternative to Akismet for the moment...1 point
-
I've updated the first post. Changed the big switch as ryan mentioned. For pete & all others gave a better description & attached some screen shots.1 point
-
That response doesn't make much sense me, but I don't know what their protection is. Images are physical and there's nothing more special about it, than if you'd put a static html with an image that lives in a folder somewhere. Adding this to after the "RewriteEngine on" in the PW .htaccess will protected any image request that does not come from the domain specified. Works well. RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.ch [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]1 point
-
Fact is your code is perfectly fine for what it archives. You'll not find any modules that could help you doing it, at best the MarkupSimpleNavigation. It is well for quickly rendering straight nested navigations. You can overwrite with you own templates and selector (global) etc, as the manual shows. However it is not suited for things like you do with products and categories as it just traverses the page tree or parts of it. For more complex navigation the PW API and the hierarchical structure makes it very easy to construct them the way you did. I wouldn't start putting it to pieces with abstraction and functions for this menu. You problem with navigation not showing when no products found would be easy with moving the output after iterating the products and test if they're linked. Then echo only if any found. For example: foreach($applications as $a) { $prod_str = ''; foreach($products as $p) { if(!$p->applications->has($a)) continue; if(!$p->sectors->has($s)) continue; $span = $p->new == 1 ? " <span class='orange sub-menu-title'>" . $this->_('novita') . "</span>" : ""; $prod_str .= "<li><a href='$p->url'>$p->title$span</a></li>"; } if($prod_str){ echo "<li><a href='$a->url'>$a->title</a><ul class='sub-menu'>$prod_str</ul></li>"; } }1 point
-
:D Nice one Ryan! And I thought that after Josh arrived the forum couldn't become any sillier1 point
-
Greetings Ryan, Yes, I was looking into this as you wrote! I don't run too many extensions, but I found one called "PageFont," which I didn't recognize, and which doesn't seem to have any information. I removed it and the links went away. Thanks, Matthew1 point
-
Interesting, but too little too late as far as I'm concerned. I was all set to build my first EE site a month ago when they pulled that "license simplification" malarkey overnight, which sent me on a lengthy exploration of various CMS systems and eventually led me here. I can't really think of a reason I'd ever go back.1 point
-
1 point
-
At the start of this new year I launched my new website: Didjee.nl (in Dutch only, sorry )1 point
-
Just updated these formatters for textile v2.5.1 which was released about an hour ago. HNY!1 point
-
And here's some additional code in case anyone might need to do something similar: It basically runs in a module if the user is logged into the forums already and they're now viewing the site and are marked as either banned or a spammer in the forum software, plus they have a user account in PW (that's all the boring code I didn't include below). $count = 0; $count += wire('pages')->find("authors=" . $u . ", include=all")->count(); $count += wire('pages')->find("dm_owner=" . $u . ", include=all")->count(); $count += wire('pages')->find("created_users_id|modified_users_id=$u")->count(); if ($count == 0) { $this->session->logout(); wire('pages')->delete($u); // Delete as we cannot trash a user } It simply counts 2 fields with Page fieldtype to see if thecurrent user is linked to any content via those fields, as well as checking to see if they've ever created or modified a page. If the count is zero, the user can be deleted, otherwise we must leave it in place to prevent things from breaking. It would be interesting to see if there's a way to find all fields that could link to a user - basically any Page fields I think as users are just pages like everything else - and iterate through them instead of the manual way I've done it for the fields above. That would certainly future-proof the code a bit and I'm sure it's possible, but I don't have the mental capacity to tackle that right now1 point
-
Some people are learning php while working with pw, I'm doing it myself. I think it would be better if things like this would be explicit on the documentation.1 point
-
I think I found the problem. It was just a TinyMCE thing. Uploaded a new version on GitHub. Should work...1 point
-
This is great Soma! Testing out here and seems to work beautifully. Please add it to the modules directory when you get a chance.1 point
-
This is what I was thinking too. And the database queries are not logged if debug=false as well. I see you've decided not to output anything in the admin.. I guess that's because most of the data already is visible there? And while the module adds no hooks in the admin, it does make ChromePhp available for use - so nevermind, just thinking aloud here . With small modules like this one there shouldn't be a problem. I think I even managed to learn something from the few hours I spent with this one. About PW itself and that I tend to overcomplicate things (had a couple of unnecessary config vars and a little abstraction layer to support other plugins as well later on). Sometimes (well, most of the time) it would be better to get something released and then keep on making it better - if there really is any need after all. I'm trying to keep this in mind: "If you’re not embarrassed when you ship your first version you waited too long." (see ma.tt/2010/11/one-point-oh/ for the whole essay). A rule not to be followed by people implementing safety measures to nuclear power plants though. But if I was to start building something bigger, it would be nice to know if someone else is already working on the same thing. That would of course be useful to us mere mortals with somewhat smaller modules too. Not all of us are able to get these kind of useful things from scratch to release during one evening like you are Soma .1 point
-
Can we also get one that comes with my next client project all set up? Thanks.1 point