Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/12/2016 in all areas

  1. LimitPageTable A module for ProcessWire CMS/CMF. Allows limits and restrictions to be placed on selected PageTable fields. Usage Install the LimitPageTable module. For the PageTable field you want to limit, on the "Input" tab include "template" or "template.label" in "Table fields to display in admin". You can skip this step if your PageTable field only allows a single template. In the module config, fill out the fields in the fieldset row: PageTable field you want to limit Role that restrictions will apply to Template you want to limit (only needed if your PageTable field allows more than one template) Field you have included in the "Table fields to display in admin" setting (only needed if your PageTable field allows more than one template) Limit Option to prevent drag sorting of items (affects all rows regardless of template) Option to prevent trashing of items (affects all rows regardless of template) Option to disable all "Add" buttons for any template You can add rows as needed using the "Add another row" button. If you are using translated text for the default PageTable "Add New" button then enter the translation in "Text for default 'Add New' button". Please note that limits and restrictions are applied with CSS/JS so should not be considered tamper-proof. http://modules.processwire.com/modules/limit-page-table/ https://github.com/Toutouwai/LimitPageTable Module config: Demo showing PageTable limited to 2 pages using 'Blank' template:
    10 points
  2. While we don't have a new core version for you this week, 3.0.41 will be here next week, with 3.0.40 becoming the new master at the same time. This week, I'll introduce something new I've been working on for awhile here (ProfilerPro), and think some of you might find it as useful as I have. https://processwire.com/blog/posts/a-look-at-the-new-profilerpro-module/
    10 points
  3. hi ryan, first of all: great blog post! and great news! i want to start a discussion here (not at the blog post comments) as the forum is the main spot for that and has more features like quoting and so on... i want to support @Michael Murphy with his request of a solid import/export helper and setting up new projects. i've developed some parts on my own but they are far from production ready and tailored exactly to my needs and my environment. what could really speed up everyones development process would IMHO be: export/import function of complete site (not site profile!) include all data into the export (also users and wire folder) include an installer script to re-import the complete site (would be great for pulling live data easily to one's local dev environment) restore site from given dump ability to wipe all users except admin ability to set new admin password and db credentials ability to reset salt the second point would help setting up new projects quickly. i always find myself installing the same modules, setting all the settings... it would even be greater to define such installation profiles via json or the like so we could host them on github and share them. this would also be great for testing / trying out new modules: grab installer (installer.grab.pw) put in file to installer config file (eg github/xyz) set database settings install
    5 points
  4. Hi everyone, I have just added the ability for the PW Info and Console panels to reference the page that is being edited, rather than the Admin > Pages > Edit page (which is generally not a page you'd actually want info about or want to run scripts on). Note, that without this enabled, the screenshots below would be showing the admin edit page with ID: 10. This option is disabled by default to avoid any confusion, but I would recommend that everyone will probably enjoy having this enabled. This idea has been brewing for a little while, but this thread (https://processwire.com/talk/topic/14745-debugging-images/) prompted me to try it out because @microcipcip needed more details about images in the admin because there is no viewable page on the front-end. Please let me know how you find this and if you have any problems!
    3 points
  5. ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:
    2 points
  6. v102 contains the remove notice on ESC feature, now I'm experimenting with a grid view of asmLists: I think this could come handy on long lists, what do you think? I could add a button to toggle full width/grid view.
    2 points
  7. COMPOSER ELLIOTT CARTER (December 11, 1908 - November 5, 2012) is internationally recognized as one of the most influential American voices in classical music, and a leading figure of modernism in the 20th and 21st centuries. https://www.elliottcarter.com/ This site was launched some months ago, and was one of the larger projects I completed so far. It took about 4 month to build. (PW 2.7.3) This was the first project I used the wireRenderFile() pattern on, and it consequently allowed me to reuse a lot of output code, as well as do a lot of markup/object caching with wirecache. The site uses DataTables for all of the major listing pages, Works, Discography and Events, allowing users to filter and search with no page reload. This probably has the most advanced caching setup that I've done so far, and one example of how it works is on the discography page: https://www.elliottcarter.com/discography/ That page has to hold all 264 albums (json object which is rendered by dataTables), and each album takes a bit of processing to render (formatting of works, artists etc.). The json for each album's list view is wirecached individually and is generated on visits to the individual album pages, so that they never get generated all at once when visiting the discography page. The complete json object containing all of the albums is also wirecached, then the final page is pro-cached. The album covers are lazy loaded so as to not affect page size or load speed. The selects on the left are also all wirecached as page or regular arrays. This results in a 1.6s page load time and a page size of 1.12 MB. Without the data being wirecached the load time is around 9 seconds to generate the page, probably longer if it had to regenerate all 264 albums, but the album info never changes, so they are permanently cached unless someone edits one. Also should note that since there is so much use of wirecache, @Soma's Clear Cache Admin was pretty much indispensable for managing all of the caches. Other features of the site include extensive use of Schema.org microdata, an events submission system, and a lot of custom stuff in the admin for managing the content, such as automated fetching of album covers from Amazon, converting formbuilder submissions into events, a custom admin dashboard etc.. There are probably 60 modules in use overall, but these in particular saved the day: MenuBuilder AdminCustomFiles AdminPageFieldEditLinks All the Selectize modules URL checker PrevNextTabs WireMailMailgun SetupPageName Changelog AdminCustomPages Twitter Feed Social Share Buttons RSS Enhanced Chosen Select Runtime Markup Batch Child Editor Tracy Debugger As well as all of the pro modules (ProFields, FormBuilder, ListerPro, and ProCache). More info, screen shots etc will be gradually posted here...
    1 point
  8. No idea why is that - could you replace "$this->config" to "wire('config')" in that line? Also what is the version of PW? If you can, could you check with a newer PHP? (eg if you can switch PHP version on the server via cPanel or other)
    1 point
  9. Wonderful, thank you @Robin S - installed on 3.0.39 and all seems to be working perfectly. This kind of extra control over PageTable fields is something I find more need of the more I use this type of field.
    1 point
  10. Without url rewriting only processwire's homepage will work and maybe – if you really want go that way – the internal GET entry point like: www.domain.com/?it=/my/path/ See the requirements: http://processwire.com/about/requirements/
    1 point
  11. If that were so PW wouldn't work full stop.
    1 point
  12. @alexcapes, @szabesz, I've updated the module to allow the limiting of multiple PageTable fields and/or multiple templates for the same field. You can now also limit PageTable fields that only allow a single template. Because the module config options have changed I'm afraid you'll need to re-enter your config if you are upgrading from a previous version. I made a thread for the module over here which has a link to the GitHub repo.
    1 point
  13. Are you talking about the Tracy debugAll() method? When you say it won't show those fields, do you mean the various properties of the images? The output in the PW Info panel is "manually" generated to include all those things. I haven't come across a built in PW method that outputs everything cleanly like that. Take a look at the code I used to generate that array: https://github.com/adrianbj/TracyDebugger/blob/ac3ff2f6cdfcb151d53f7938d3f4ec270f23b115/ProcesswireInfoPanel.inc#L313-L367
    1 point
  14. Looks like you are viewing this on the backend - you need to view that panel/section when viewing the page on the front-end of the site. Remember that I said getArray(), not toArray()
    1 point
  15. I can't reproduce - are they still in the DOM or are they just invisible? Could you narrow it down to a certain submodule?
    1 point
  16. It's all about checking the $event. Using Tracy, inside your runPatch() method, do this: bd($event); That will return something like: Now that shows that you are looking for: $event->arguments[0] Just to confirm, do: bd($event->arguments[0]); and you'll get: which shows that you can simply do: if($event->arguments[0] === 'MyModuleName') {
    1 point
  17. You need to create a function which hooks in LanguageTranslator::getTranslation() to manipulate the result.
    1 point
  18. This is a start for you that comes from the Migrator module: $p = $pages->get() // use this to get the page that you are importing comments to foreach($comments as $comment){ $c = new Comment(); $p->of(false); $c->text = $comment['text']; $c->cite = $comment['cite']; $c->email = $comment['email']; $c->ip = $comment['ip']; $c->website = $comment['website']; $p->fieldname->add($c); $p->save(); // setting the status doesn't current work due to this: https://github.com/ryancramerdesign/ProcessWire/issues/1034 $c->status = $comment->status ? $comment->status : 0; //need to set after saving to allow setting status without being subject to moderation settings $p->save(); } This assumes that you have already parsed the rows of the CSV file into the $comments array. To do that, take a look at: http://php.net/manual/en/function.str-getcsv.php Hope that helps to get you going.
    1 point
  19. What I decided to do was leave the RTE fields alone. By default that allows subdomains to link to any page in the tree. In our case, this is doesn't present any permissions issues since we don't have editors who need to be "jailed" to their subdomain. I decided to use a textformatter to rewrite the links on output. It's pasted below in the event anyone else needs something similar. <?php class TextformatterMultisiteLinks extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Multisite Link Formatter', 'version' => 100, 'summary' => "Converts links in RTE fields for multisite setups.", 'author' => 'Tom Reno (Renobird)', 'requires' => "Multisite" ); } public function format(&$str) { if (wire("config")->MultisiteDomains && wire("config")->httpHosts){ $rootSite = wire("config")->httpHosts[0]; // make sure primary domain is first in config.php $document = new DOMDocument(); $document->loadHTML($str); $xpath = new DOMXpath($document); foreach ($xpath->query('//a[@href]') as $a) { $href = $a->getAttribute('href'); // Check $href against our domain roots. Rewrite accordingly. foreach (wire("config")->MultisiteDomains as $key => $domain) { $domainPageName = $domain['root']; if (strpos($href, $domainPageName) !== false) { $url = str_replace($domainPageName, "http://$key", $href); $a->setAttribute('href', $url); break 2; // this link was rewritten, so move on to the next. } } // append full URL if not viewing the $rootSite if ($_SERVER['HTTP_HOST'] != $rootSite){ if ((substr($href, 0, 1) == '/')) { $a->setAttribute('href', "http://$rootSite" . $href); } } } $str = $document->saveHTML(); } } }
    1 point
  20. The JSON import/export functionality Ryan is talking about is already in the admin. The buttons are located on the bottom side of the Fields and Templates page in the admin: If you want to automate database migrations you could use the Migrations module by lostkobrakai. There are several other posts floating around dealing with this issue.
    1 point
×
×
  • Create New...