Leaderboard
Popular Content
Showing content with the highest reputation on 06/06/2017 in all areas
-
10 points
-
I have not seen an htaccess file with a version number on it. The install procedure should have renamed the htaccess.txt to .htaccess if your permissions were set correctly. Is your document root defined as reidsengland ? Or is the document root reid ? If the docroot is reid, and you placed the PW files in the reidsengland sub folder, then the rewritebase should be /reidsengland/. You have probably already seen this, but I'm posting it for others too. Troubleshooting5 points
-
This is my second project based on processwire. I love it. Please share your meanings http://baumaschinen.guru5 points
-
Yeah, I tend to stick to the tree-model for this kind of thing. In this case, I tend to use "legal/terms", etc. If need be, there's always Jumplinks for quick redirects.2 points
-
There's also this, if you don't want to create your own module:2 points
-
@Petra Welcome to the forums. In such cases you have 2 handy friends in ProcessWire. https://modules.processwire.com/modules/process-jumplinks/ https://modules.processwire.com/modules/process-redirects/2 points
-
FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/ GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin). The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen. The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages. The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan! Warning/Consideration Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API Backend Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer. FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. A very simple example. return 'Hello'; Simple example. return $page->title; Simple example with markup. return '<h2>' . $page->title . '</h2>'; Another simple example with markup. $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example. $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example. $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do: return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows: return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup') Access the field on the current page (just like any other field) echo $page->runtime_markup; Access the field on another page echo $pages->get('/about-us/')->runtime_markup; Screenshots Backend Frontend1 point
-
Displays countries and continents and their iso codes. The "value" for each country is the two-letter country code. As an added bonus, the country names are displayed in the language of the user (sorted by name ASC) if the appropriate translation was added. read more ...1 point
-
Some hosts don't like 777 permissions - I suggest you change all directories to 755 and all files to 644 (apart from /site/config.php which should be more restricted). A good FTP client will be able to change permissions recursively, with separate permissions for directories and files. Another thing that could cause your issue is lack of disk space - check to make sure you haven't run out.1 point
-
Thanks @rick I always like to read how other people approach a problem as it gives me more options when said problem becomes one of mine!1 point
-
I love PW. I post a question, take a lunch break, and the answer arrives! I guess my suspicion about the name of the .htaccess was correct—and that fixed it.1 point
-
@Juergen are you using a linux distro? The font type used is not a default on linux and gets substituted by a different font. That is what's causing this. I will either change the padding or take another font. @szabesz I changed the flip cards and they look better now. Execpt for the long names...1 point
-
Hi @SamC, Yes, my /home/policy page uses the policy template. The /home/policy/privacy and /home/policy/tos pages also use the policy template from the allowed template for children setting. I just redirect /home/policy page to /home/policy/privacy page to prevent access or 404. As I said, there is probably a more ProcessWire-esque way to do it, but I don't know what that would be.1 point
-
No, I'm not referring to the Alternate template file feature. I'm just saying that if you create a template without a file, and later decide you want to add a file for it, all you need to do is put that file (named the same as the template it relates to) into /site/templates/. Maybe you never tried it that way before but give it a go and you'll see what I mean.1 point
-
I know this is an old thread, but I ran into a similar issue today. I was trying to select a row in a profields Table by the contents of its text field, but selectorValue() was stripping out the "#" character from the selector value, preventing the match from being found. I had always sort of assumed that selectorValue just escaped the value to make it safe for a selector, without actually altering the value. But now I see that this isn't the case (and it also limits the length to 100 characters by default). It looks like the only way to achieve what I'm looking to do is to strip out double quotes from within the input string that I get and then wrap the whole string in double quotes (as Ryan describes above). If I understand correctly, this would be a safe way to escape the input. The only problem with this is that double quotes then cannot be used in the text field, which could be an issue. Is there any way to create a safe selector that can handle double quotes in addition to commas, hashes, and the other characters that selectorValue() strips out?1 point
-
How did I miss this? Here's me logging into cpanel > phpmyadmin > export DB > unchecking cache data... blaaaaaaah! Must give this a try. Thanks @Ivan Gretsky.1 point
-
Hi @gebeer like @Juergen said, you should have no problem doing what you need with Recurme. Perfect use case for this module i am experimenting with an adjustment to the Recurme interface to account for all day events and time-end field. Hoping to release an update that addresses that need this week.1 point
-
Hello, it´s an iOS thing. https://wouterdeschuyter.be/blog/how-to-disable-viewport-scaling-in-ios-10-you-dont-941140811 You should configure your safari1 point
-
Stripe (https://stripe.com/de for your needs) is very easy to use and integrate.1 point
-
For that kind of system I'd probably go with laravel spark.1 point
-
Years later we have more options) There is a special module by @ryan for that now. You can also do a backup from cli with wireshell. There is a nice module by @flydev still in the way, but looking promising. Look here for some discussion and 3rd party tools.1 point
-
1 point
-
A Followup This was an interesting conversation by all parties. What I didn't get was what actual syntax that was put in the /site/config.php file. While this may not matter to more experienced users, it makes a difference to others. My sites don't use Multi-Language and I was still confronted with the error that @EyeDentify noted in the original post when updating an existing site to ProcessWire 3.0.55 This is what I put in the /site/config.php file to make error go away /** * Installer: SetLocale Setting * * This is now needed since ProcessWire 3.0.53 to set local information * */ setlocale(LC_ALL, "en_US.utf8"); As @matjazp stated, it doesn't really matter where in the file this goes. What was confusing to me is that most other settings in the /site/config.php file started with $config and it wasn't clear whether this setting needed to follow that style. As I said, it may not be important to experienced PHP users, but knowing what to put when confronted with this warning is helpful. As an aside, it would also be helpful to know the exact syntax that is needed if using the init or ready files. Maybe I have missed something in reading all this that should have been clear to me and excuse me if I have. If what I have used is incorrect, I ask that someone provide the correct format (styling). Thanks.1 point
-
you could also put everything in one file to have all translations aggregated in one page in the admin custom code: return wireRenderFile('fieldmarkup', array('field' => 'calendarbox')); fieldmarkup.php <?php switch ($field) { case 'calendarbox': $out = '<div>...</div>'; $out .= '<p>...</p>'; echo $out; break; } i guess for easy fields that would be better than having a file for each field...1 point
-
Just came here to say that this module works brilliantly! I have made an "email sender field" that uses the page's data to manage surveys for a certain product and right now I'm doing a "defaults selection for repeater field" for a repeatear field with page fields in it that will describe features of a product. It's really nice to just hack your way so fast with this! I use it with wireRenderFile() which rules because it lets me handle the markup nicely in a separate file in my preferred text editor. EDIT: Added "mail settings" screenshot. Jus realized my description text is all messed up engrish1 point
-
@Rudy I did take a look at your take at it and the subfolder option didn't seem to work. I've now enhanced it to be configurable to different optional subfolders to look for a ProcessWire installation. I've also taken the trailingSlash part out, because ProcessWire does not enforce trailing slashes, but it can do it on it's own if you want it to. https://gist.github.com/LostKobrakai/5328d6f64e9dc06a8776d0231c6628c61 point
-
thanks again for this awesome field! if anybody needs excel-like tables this is easily possible like this (startingpoint): create a folder like /site/modules/HandsonTable copy https://github.com/handsontable/handsontable to this folder create a runtime field with this content: return wireRenderFile('../modules/HandsonTable/HandsonTable.php'); create your php-file /site/modules/HandsonTable/HandsonTable.php <?php $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/moment/moment.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.js"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.css"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.css"); ?> <div id="example"></div> <script> var data = [ ["", "Ford", "Volvo", "Toyota", "Honda"], ["2016", 10, 11, 12, 13], ["2017", 20, 11, 14, 13], ["2018", 30, 15, 12, 13] ]; var container = document.getElementById('example'); var hot = new Handsontable(container, { data: data, rowHeaders: true, colHeaders: true }); </script> moment and pickaday are not needed in this example and just as a showcase and reminder... It get's a little more complicated if you need storing/editing features but i need it only to show some data and my client can copy/paste data to excel/google drive sheets.1 point
-
http://www.adminer.org/ it is a single file php replacement for phpmyadmin.1 point