Leaderboard
Popular Content
Showing content with the highest reputation on 01/15/2015 in all areas
-
Basicly you have one folder for templates by default. This is configured to be in "site root" + templates/ You are able to overrule this setting from the site/config.php as follow $config->urls->templates = $config->urls->site . 'mytemplates/'; $config->paths->templates = $config->paths->site . 'mytemplates/'; A trick i use a lot when developing in a live site is to duplicate the template folder and rename the copy to templates-dev. Then make sure i have an other domain (or subdomain) pointing to the hosting, for example dev.domain.ext and for the live site on www.domain.ext With the following code i can access the development templates while normal visitors keep getting the default templates. /** * Development: Alias for template-dev access * */ if($_SERVER['HTTP_HOST'] == 'dev.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-dev/'; $config->paths->templates = $config->paths->site . 'templates-dev/'; $config->debug = true; } You can make up all kind of 'rules' to go by when overruling the templates folder with php from the config.php file. For example serving the same site with different layout and code for mobile on m.domain.ext /** * Mobile: Alias for template-mobile access * */ if($_SERVER['HTTP_HOST'] == 'm.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-mobile/'; $config->paths->templates = $config->paths->site . 'templates-mobile/'; }17 points
-
This techwars stuff drives me a little nuts because we're not "at war" or in "a fight" with anybody, as they imply. The other CMS projects are our peers not our enemies. Though I understand, wars and fights are controversial and thus marketable. Techwars on Twitter has been spamming the #processwire hashtag for several months. I like to occasionally search for ProcessWire on Twitter to see what's up there, and you can't search for ProcessWire without getting 80% techwars tweets… All implying we're in all of these fights, skirmishes, duels and bloody battles to the death with modx, silverstripe, expression engine, etc. Their average tweet count per day is 1075 (all appear to be the same auto-generated tweet with different product names substituted). I just don't like that people searching for ProcessWire on Twitter might be getting the wrong impression, like we're not friendly or something. That being said, I love the comments that you guys added to their site. If there is a battle at the techwars site, ProcessWire is winning it.14 points
-
A quick callout in defense of us 'starters'! My current process before asking a question in the forum is to: 1. google the forums, if I find code: 2. test the code on my site, noodling around for a few hours usually. If I don't find code, or can't get it to work: 3. google php references (I'm new to php, but fine with html & css) 4. test code I found at php references, if that doesn't work 5. google pw forums again 6. ask question on the forums If there is something else I should be doing to avoid being typified as 'jumping in and expecting an answer' or being 'lazy' or 'impatient', please let me know! I think we have a great dev community here, and I look forward to one day knowing enough to help others. Please don't hate on newbies... we're trying. On another topic earlier in this thread... as for tech wars... I think this is an archetypal theme (battle to the death! Who! Is! Deadliest!) that will always make money, and is therefore never going away. The important thing is that we recognise it for what it is - a distraction - and work on feeding the good community vibe here in spite of such distractions.11 points
-
if anyone fancies posting a comment, you might like to say something about the community being so good that no one feels the need to post on stackOverflow....8 points
-
Amazing approach. Can I add this as a recipe?7 points
-
Support Forums are hard to maintain. There will always be an influx of new people with new ideas. Our challenge is to incorporate these individuals while teaching them good web development techniques. These people will be the next group of teachers about ProcessWire. @pwired makes some valid statements. I believe everyone should be heard, in a professional and mostly courteous manner. There will always be newbies that will challenge our patience, however we need to just remember that learning takes time. They are excited because ProcessWire is a fantastic development platform. We will have troublemakers join our group, however we need to not change who we are based on their need to make trouble and discord. There are great and extremely talented people from around the world actively participating in this forum. If we maintain our technical excellence and dignity, then it doesn't matter what a few idiots have to say. Anyway, once they see that we are about positive outcomes they will fade away. We should be striving to see everyone reach that initial "AHA" ProcessWire moment, no matter how long it takes. This is a great Forum and we collectively need to ensure that we keep it that way. Best Regards, Charles6 points
-
My personal experience has shown me that the challenge with starting out with anything is knowing the right questions to ask. None of us know everything but when you get to a certain level you become an expert at knowing what questions to ask then the ability to find the answers to those questions becomes that much easier.6 points
-
6 points
-
This is a feature of PHP. String literals with double quotes (") will evaluate the variables within. For clarity, you could also enclose the variable in curly brackets ({}) like so: echo "You must be the pride of {$subject_hometown}!"; Only if you use single quotes (') the string will be parsed as-is, and you must use concatenation or other string operations to change it. Note that this means that within single quotes, escape sequences will not work either, so you can’t do the following, even though there are no variables in there: echo '\r'; ---- Added by Nico: More infos: http://stackoverflow.com/questions/10512452/php-using-a-variable-inside-a-double-quotes (and I marked it as solved)5 points
-
Features that are released for the 2.5.14 version are not going to work in your 2.5.3 install. Here http://processwire.c...updates-2.5.14/ there is a quick tutorial on setting up an alternate user template and parent. You would need to first update to Development version 2.5.14 to gain access to these features, as they are introduced starting with this version.5 points
-
People who are just one step ahead of the newbies are the best teachers for those newbies. Those newbies will be the next teachers for the new generation. We have a healthy forum and I love the way it goes.4 points
-
@kathep, I personally think that you ask very good questions. From what I have seen, you follow-up for clarity and contribute by articulating your thoughts.4 points
-
Hi everyone, I did a little thinking and coding on this issue last night. There is a gist on this post (https://processwire.com/talk/topic/8605-user-editsaddsmove-only-his-own-page/?p=84835) which hides uneditable pages, but be sure to read my comments in that post. And based on my comment about the issues with "is editable" checks and the need to display non-editable parents to allow a user to access editable grandchildren, here is a much more comprehensive module that allows the ability to hide specific pages (and obviously their entire branch of children/grandchildren) based on the user role. It is based off my Page Protector module so it will look familiar to anyone who have used that. It is just a first draft, so test carefully It is attached here for now. Any thoughts? AdminPageHider.zip4 points
-
A variable in double quotes will get parsed fine. If your first code it was in single quotes you would see $page->projects_managers instead . So, the code is not incorrect. I do like to concatenate though for code readability/highlighting.. http://www.scriptingok.com/tutorial/Single-quotes-vs-double-quotes-in-PHP4 points
-
... got lost in crone Here is another one ... cronjob for database backup. All Informations here: github: https://github.com/kixe/CronjobDatabaseBackup PW Modules: http://modules.processwire.com/modules/cronjob-database-backup/3 points
-
Ask and you shall receive! Check out today's dev commits https://github.com/ryancramerdesign/ProcessWire/commits/dev "Add Adrian's ProcessTemplateFieldCreator for quick access to create new fields in ProcessTemplate."3 points
-
My recommendation: http://usefinch.com. Using it primarily for checking local virtual hosts on devices and inside Parallel VMs (with own hostname and no subfolders) but should be suitable for n0sleeves' use case as well.3 points
-
Nothing - but isn't it nice that people seem to get their answers here? I have no proof, but there always seems to be a link between a lack of questions getting answers on a software's own support forum and the number of questions on StackOverflow. I have four outstanding questions on another bit of software's support site that have never been answered or even viewed. Frustrating, to say the least.3 points
-
It did the same to me but it works now with 2.5. The issue is that Flickr switched all API requests to the https protocol. Change http:// to https:// in the InputfieldFlickr.js file and it will work again. @apeisa, thanks for the great module, you might want to update it with https, cheers.3 points
-
Almost You need only one remote repository where the code lives, but with two branches. It's the same git model as ProcessWire uses: The master branch contains the latest stable code, whereas the dev branch contains all the new features. Live Website (e.g. www.yourdomain.com): - master branch is checked out, to get new commits from origin: git pull origin master Test Website (e.g. dev.yourdomain.com): - dev branch is checked out, to fetch the new commits: git pull origin dev Yep, but totally separated, not the dev version inside a sub folder. Also separate databases.3 points
-
My setup is very different. I do all my web development work online using Dedicated servers. I create a development domain environment for each client and they have access to review the website work as it's being done. This works great for me since the transition from development to production is minimal. I brief each client on an at least weekly basis (online meeting, via phone or in-person) on the topics that are important to them. Each of my clients has 24 hour access to a customized project management website (Processwire based & still under constant development: i.e. alpha status). I make use of the client project website, Evernote (shared notebooks) and Dropbox (shared folders) to maintain all client related work and documentation. I work to ensure that the 3 systems stay linked together in a cohesive manner. A majority of my clients are not associated with any web development work, however I make sure they are familiar with ProcessWire through the client project websites. They get to see and work with the front-end/back-end (Admin) sides of ProcessWire on a constant basis.3 points
-
Finally bit the bullet and started learning ProcessWire with my own website. I've been using WordPress for about 10 years (and B2/cafelog before that!) but I really like what I see out of ProcessWire. I figured I should eat my own dog food so to speak before trying to use PW on a client site, so I present my redesigned portfolio site. http://builtbydavid.com/ BTW thanks go to everyone in this forum that contributes information. Whenever I wasn't sure how to do something, the site documentation here helped, and the forum posts helped where the documentation left off.3 points
-
I worked it out. Go to /site/templates/admin.php and add in (above the controller.php require) <?php $config->styles->add($config->urls->templates . "favicon.ico?t=" . time()); ?>2 points
-
Peter, have you tried the latest dev? Adrian and Ryan might have baked something for you2 points
-
If you know the pageid, you only need to get the page: // get the page for that id $internalpage = $wire->pages->get($pageid); // now check if the page could be found if ($internalpage->id != $pageid) return false; // you can also check for the id not 0 if ($internalpage->id == 0) return false; So, assuming your $pageid is right, you will pass the lines above and you should be able to access your images field as usual: $images = $internalpage->images; // lets check if there are images available or if the field in this page is empty, e.g. not uploaded any image to it if (count($images)) { foreach($images as $image) { // do stuff with the images ... } } BTW, welcome to the forums.2 points
-
I don't care if a question is weird i'd happily answer them even starter questions, because a community is one where one shouldn't be afraid to ask a question with the fear of being ridiculed. worst case scenario for me would be to simply refer the forum with the answer. @kathep i like your system to finding out information.2 points
-
Very true Dazzyweb. Eg: You know what a foreach is in php: "How do I loop through images in PW with foreach?" You haven't ever come across a foreach loop: "I have thirty pictures in my image field and I have tried to list them but nothing comes out, how do I do it?"2 points
-
2 points
-
2 points
-
@kixe Thank you for this module - I don't know how I managed to overlook it until now. It should come in very useful. Is there any chance you could either add an option to allow the automatically generated filename to include the creation date, or move the filename generation into a hookable method so people can supply their own name generator if needed? Regardless of the above request, thank you again!2 points
-
2 points
-
I think this recent post can be helpful here.2 points
-
You can get it in a PHP section of your template files like this... $ref = $_SERVER['HTTP_REFERER']; Be aware that this variable can be unreliable as it is up to the visiting browser to send it and it can also be forged. Most of the time it will be correct though. More info here.2 points
-
Marcus & Owzim, great project - looking forward for contributing every now and then (just created one pull request)!2 points
-
I use adminer instead of phpmyadmin, for a long time now. http://www.adminer.org/en/phpmyadmin/2 points
-
PROCESSWIRE PROFILE EXPORTER This module serves two purposes: To enable exporting of ProcessWire 2.0 sites to a profile that can then be imported into ProcessWire 2.1 (i.e. to upgrade to 2.1). To enable exporting of ProcessWire 2.1 site profiles for sharing or distribution with others. In either case, the profile exporter does not touch your existing site. It just creates files in a directory (/site/install/) that can then be used for a fresh installation of ProcessWire. PLEASE NOTE: Consider this module alpha test only. It has not had a lot of use or testing yet so it's advisable to use it in a test environment and not on a production server at this time. I am posting this for those that indicated they wanted to help test the PW 2.0 to 2.1 upgrade process. HOW TO INSTALL Download at: https://github.com/r...ssExportProfile Place the file ProcessExportProfile.module in /site/modules/ Login to your admin, click "Modules" at the top, and click "Check for new modules" Click "install" for the Process > Export Profile module. It will create a new page where you can access it under the Setup menu. HOW TO EXPORT A PROFILE A profile consists of your site's database, files and templates. To create a profile, Go to Setup > Export Profile. Read the instructions and continue. Once the profile has been created, you can copy it somewhere else, zip it up, or [if performing an upgrade] copy it directly into your PW 2.1 directory as indicated in the 'upgrading' section below. The profile consists of files in these directories: /site/install/ < required /site/templates/ < required /site/modules/ < optional: use only if you have custom modules to include in the profile /site/templates-admin/ < optional: use only if you have a custom admin theme to include in the profile /site/assets/ < optional: use only if exporting all of /site/, and it should be left empty like PW's default profile* /site/config.php < optional: use only if you want to specify custom config settings, leave out otherwise** These directories collectively form the entire /site/ structure of a ProcessWire installation. If using the profile to upgrade ProcessWire from 2.0 to 2.1 then you'll only want the first two directories above (install and templates)–see the 'Upgrading' section following this one, as the instructions for upgrading are a little different than if you were exporting profiles for distribution. If you intend to share/distribute your profile with others (as opposed to upgrading), you'll want to ZIP them up into an archive (or use something like GitHub). You may want to make your profile include the entire /site/ directory for easier installation by others. If using the entire /site/ directory as your profile, then just copy all the /site/ files from ProcessWire's default uninstalled profile and replace the directories/files that you want to. For instance, you'll always want to replace the /site/install/ and /site/templates/ directories, but if your profile doesn't include plugin modules or configuration file changes, then you'd keep the default /site/config.php file and /site/modules/ directory from ProcessWire's default profile. *Any time you are including the entire /site/ directory as your profile, you'll want to include the /site/assets/ directory exactly as it is in the default ProcessWire uninstalled profile. That means the directory is empty, minus an index.php file. During installation, the installer copies files from /site/install/files/ to /site/assets/files/ and ensures they are writable. ProcessWire's installer also creates several other directories under /site/assets. But you don't need to worry about that. **If you ever do include a /site/config.php in your profile, make sure to remove the last 5 lines that contain confidential information about your database and user system hash. Once you've saved your profile somewhere else, you should delete the files that this module saved in /site/install/ (they might be consuming a lot of disk space). You'll see a link to do this after you've finished exporting a profile. UPGRADING FROM PROCESSWIRE 2.0 TO 2.1 This upgrade process is a little different from what you may have seen before. We won't actually be upgrading your current site. Instead we'll be exporting a profile of it, and using it to install a new/fresh copy of ProcessWire 2.1. To make this work, you'll have to install your copy of ProcessWire 2.1 in another location or another server. Once you've completed the installation and verified that everything is how it should be, you may then replace the original ProcessWire 2.0 site with the new one. It should be noted that this upgrade does not cover user accounts or access control. You will have to re-create any user accounts and access settings in the new system. This was necessary because PW 2.1 uses an entirely different user system and access control than PW 2.0. Should you have a lot of user accounts that need to be converted, let me know more in the PW forums and I can guide you through how to handle your specific case. Performing the upgrade 1. Export a site profile as described in the previous section. 2. Download the latest copy of ProcessWire 2.1 at http://processwire.com/download/ and install in a new location. If you are installing on the same server in a different directroy, then don't use the same database as you did in 2.0. Instead create a new database that you will be using for 2.1. 3. Before starting the 2.1 installer, copy these directories from your ProcessWire 2.0 installation to your ProcessWire 2.1 files (completely replacing the directories in the 2.1 files): /site/install/ => /site-default/install/ /site/templates/ => /site-default/templates/ 4. Now run the ProcessWire 2.1 installer by loading the URL to it in your browser. If all goes as it should, you'll see your 2.0 site now running 2.1. There are some likely issues that may occur, so read the following section about troubleshooting whether you think you need to or not. 2.0 TO 2.1 UPGRADE TROUBLESHOOTING I installed 2.1 using the new profile but now I get a 404 Not Found for every page If you run into this problem, login to ProcessWire 2.1 (/processwire/), edit the template used by your homepage, click the "access" tab and "yes". Then check the box for "guest" view access, and save. Your site should now be functional. I installed 2.1 using the new profile but now many pages have no title ProcessWire 2.0 assumed that all pages had a title field whether it was ever officially assigned to the template or not. ProcessWire 2.1 is different in this regard. So if you run into pages without titles, edit the templates used by those pages, add the field 'title' and hit save. The issue should now be fixed. I ran out of memory or had a timeout when exporting a profile or installing the 2.1 site with the profile On a large site, it's possible that the resources dedicated to PHP might not be enough for the exporter or installer to complete it's job. Should this happen to you, we may need to do one or more parts of the process manually. So if you run into this scenario, please post in the forum and we'll get it figured out. I installed 2.1 and all went well but I now have a non-working "Export Profile" page on my Setup menu (last item) This is the page used by the Profile Exporter module on your 2.0 site. Your 2.1 site won't have the Profile Exporter installed and you can safely delete this page or drag it to the trash.1 point
-
On GitHub: https://github.com/plauclair/AutodetectLanguage PW's Modules repo: http://modules.processwire.com/modules/autodetect-language/ This ProcessWire 2.x module tries finds a best match between HTTP_ACCEPT_LANGUAGE and currently installed languages. If a match is found, the user will be redirected from the requested page to the same page in his preferred language. This match occurs only on the first page load, and will work with default caching on. If no match is found, the website will revert back to the "default" language. Installation info and more details on GitHub. Please submit any bug on the bug tracker, as it is easier to track different issues.1 point
-
Hello, I'm using a function to limit an entry to a predetermined number of characters. This is what it looks like: <?php // Excerpts a field to $limit length function excerpt($str, $limit = 400, $endstr = '…'){ $str = strip_tags($str); if(strlen($str) <= $limit) return $str; $out = substr($str, 0, $limit); $pos = strrpos($out, " "); if ($pos>0) { $out = substr($out, 0, $pos); } return $out .= $endstr; } ?> It works like a charm but sometimes i want to limit two different fields within the same function: <?php echo excerpt($result->summary. $result->body); ?> This works 'OK' but this way i can't get a space between the summary text and the body text. It's i minor issue but it looks kinda dull. For example: "Hello, this is the summary.And this is the body text." My PHP knowledge is low but my guess is that the problem arises with the "strip_tags" function. Is there any way around this? Thanks for help /Daniel1 point
-
There is no space because you didn’t put one there Why not do $partone . ' ' . $parttwo? Edit: Also, upvote for using a proper ellipse char.1 point
-
Update: Blog version 2.3.1 Bugfixes Thanks to @matulkum, fixed this bug (thanks @bwakad) where...unparsed HTML would be output in Blog Posts/Categories/Tags Dashboards in multilingual ProcessWire environments. Additions As per https://processwire.com/talk/topic/7403-module-blog/?p=83971. Thanks to @Gazley, added 'post_small_tag' option to renderPosts(). Enables developer to select HTML tag to wrap around a 'small' Blog Post, i.e. a post excerpt/summary. Value should be left blank if no tag is desired. Especially useful if using the option 'post_small_allowable_tags'. The default tag is '<p>'. Use option as: //$options = array('post_small_tag' => 'div');//note we enter the tag only without the angle brackets! //render a limited number of summarised posts $content .= $blog->renderPosts("limit=5", true, $options); Requests Thanks to @loopyloo, added MarkupBlog frontend demo screenshot to README. See post #304-312 for why...1 point
-
1 point
-
<offtopic> But don't ever never let newbies touch waterand never feed it after midnight!!! </offtopic>1 point
-
Thats only what i meant in my last 2 posts on this. As i'm a starter, too - the best thing here was that i'm felt like i'm at home now in this forum - not in any strange or foreign part of the web. I'll give back other starters a helping hand since i'm no pro this my only limited skill.1 point
-
I think maybe the original question was not about changing the path to the folder where templates reside, but rather about being able to put template files in different subfolders of site/templates (or something different, adjusted with the methods, described above). Although you can change the file used as template file for the template in Admin -> Setup -> Templates -> Edit Template on the Files tab, you cannot point to something like "views/product/product.php" there as far as I know (at least it did not work when I tried). You can only choose different file in template folder. It could be just great if you could.1 point
-
I think it is better to have your overrides as well as custom styles included in app.css to reduce http requests. This is all made easy with sass via @import. If you customize foundation, you will not benefit from framework being cashed in browser anyway. So put you custom styles in app.scss after the foundation import directives or in custom included partials.1 point
-
1 point
-
I agree with Charles. @pwired, sorry but honestly I find that you are too harsh, if not insensitive, in some of your comments. And they don't always make sense actually. Edit: Charles = cstevensjr1 point
-
As wanze said, just use different git branches so keep track of different development stages.1 point
-
I would setup a live and test installation. The test installation corresponds to the "dev" branch in GIT, where the development continues. If the client needs to check the current state during development, you can pull on the test server. Once the development is tested and ready to go live, I merge into the master branch and pull on the live server.1 point
-
Clinton, I've updated the module to support this. You'll find it in the latest commit in the PW 2.2 source. To enable, specify '0' as the max length for the description field in the module settings. Can you confirm that this solves the issue and enables use of the full article? Thanks, Ryan1 point