Leaderboard
Popular Content
Showing content with the highest reputation on 11/07/2016 in all areas
-
I think that's just a coincidence if you add several pages one after the other without reordering them in the field. But because a page that's in a PageTable field can reside anywhere in the page tree there could be other pages added (that have nothing to do with the PageTable field) which would affect the sort property of the page. Intentional, because there are really two sort values - the sort property that belongs to the page itself (the tree sort) and the sort that belongs to the PageTable field. This is in the PT database table but doesn't seem to be passed though as a property of the pages when you get them via the PT field. @alexcapes The order of the field is set according to the order of pages in the PageArray (or array of page IDs) when you save it to the field. For example: $page->setAndSave('my_pagetable', array(1009, 1002, 1007)); // an array of page IDs // or $pa = $pages->find("template=my_template, sort=title"); // create and sort your PageArray however you like $page->setAndSave('my_pagetable', $pa); You could also do things like get the existing PageTable PageArray and then add pages using methods like insertAfter() But are you sure you have to delete and recreate pages? You could keep the existing pages and change just about any property of them without actually deleting them. Maybe explain the whole process of what you're doing and someone may be able to suggest a different approach.3 points
-
I don't know why the ServicePages isn't in the modules database, but it is still available on github.3 points
-
Thank you both - @kongondo and @LostKobrakai! I knew there had to be a way to do that, but wasn't sure even how to google it. I'm sure I read right past that part of the docs. Here's what I needed the Or Groups for: "related posts"! I've got two page-types that can be related via Categories, Tags or a Connected Client, and I wanted to be able to show other Posts or Projects that had the same Category, Tag or Client attached. Previous versions of the following function were always finding related posts only when there was an exact match of Categories+Tags. But with your help, I was able to rewrite the function to the following: public function getRelatedPages( $base_page_id, $page_type ) { // set values $pages = wire("pages"); $page = $pages->get($base_page_id); $search = array(); $matches = new WireArray; // Categories if($page->Categories->count > 0) { foreach($page->get("Categories") as $category) { $category_array[] = $category->name; } $category_string = implode("|", $category_array); $search[] = "(Categories={$category_string})"; } // Tags if($page->Tags->count > 0) { foreach($page->get("Tags") as $tag) { $tag_array[] = $tag->name; } $tag_string = implode("|", $tag_array); $search[] = "(Tags={$tag_string})"; } // ConnectedClient if(isset($page->ConnectedClient)) { $search[] = "(ConnectedClient={$page->ConnectedClient})"; } $search_string = implode(", ", $search); $matches = $pages->find($search_string)->sort("random")->filter("id!={$page->id}, template={$page_type}, limit=3"); // Debug // $this->dd($search); // Output the final matches return ($matches->count > 0) ? $matches : NULL; } Thanks again!3 points
-
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(); } } }3 points
-
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.3 points
-
hi, I would create the sections as sub-pages in the backend: - onepager -- section a -- section b ... -- section n For the onepager contents, you can query for the 'onepager' children and loop them out into the sections markup. For the id attribute you can use the childpage's id, like 'id="section-{$section->id}"': $onepager = $pages->find('selectorfortheonepagerpage'); // i.e find('/name-of-the-onepager'), find('template=onepager_template') $onepagerSections = $onepager->children; if($onepagerSections->count){ foreach($onepagerSections as $section) { echo '<section id="section-'.$section->id.'">(..........)</section>'; } } ... In the same way you can build the navigation, using the section id for the anchor. no need to use the simple nav render, just loop over the onepager children once again and build your navigation markup with "a href="{$onepage-r>url}#section-{$section->id}" ... if($onepagerSections->count){ echo '<ul>'; foreach($sectionNav as $item){ echo '<li><a href="''.$onepager->url.'#section-'.$item->id.'">'.$item->title.'</a></li>'; } echo '</ul>'; } ... This could be optimized to go in one loop, creating two output variables, one for the nav, one for the sections, and echoing them out later, but for illustration purposes I think this'll work. cheers, Tom3 points
-
Thanks for the feedbacks. I added the ListerPro line and also applied some tweaks to the quicklinks, eg close on mouseleave and don't restrict its width to 230px. I've added an exception to the ListerTweaks so in theory it shouldn't modify ListerPro columns but I can't check whether it works or not. If it's not, I will probably make the columns optional. The jumping column widths on row hover is a design issue, I have no idea atm how to fix it. Probably the easiest one would be to use icons to save some space. @Macrura I think I managed to fix it - some rows were removed that actually isn't needed anymore. @adrian The sidebar can be toggled by the arrows (left-right) though I'm not convinced that this is a good thing (sometimes I accidentally toggle it). I prefer it always on, I'm kinda lost if I don't see it I'll think about it, though I don't know how to make sure they don't see it on their initial view (cookie?). Or you mean to eliminate the sidebar for non-superusers entirely? Module disabled vs template edit action - thanks, corrected. v0997 is up with all these above. I think the first part of this is solved in the latest version. The second part is trickier because the "one-line sidebar menus" can be of arbitrary width, but the quicklinks menu is positioned to fixed so it is not positioned after the sidebar. The "one-line sidebar menus" was an attempt to make it easier to find an item on the sidebar. Perhaps it's time to get rid of it3 points
-
I just made it compatible with both PW 2.5+ and 3+ http://modules.processwire.com/modules/fieldtype-yaml/ https://github.com/owzim/pw-fieldtype-yaml3 points
-
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
-
<?php if($tab_size == 'too big') { use \CSS; $to_change->it(); } else { $it_looks = 'stupid'; } ?> When pasting code indented with tabs into the forum the indents are too large. It's simple to fix with a bit of CSS: pre { -moz-tab-size: 4; tab-size: 4; } Could someone with the necessary access add this? The big indent bugs me so much I usually find/replace the tabs with spaces when posting code. And as is universally agreed by all quality coders: tabs are much better than spaces2 points
-
Ok, I think the autofocus is could be easily added only to module/field/template edit pages. Sorry about the Reno search focus - it's the double shift (tap shift) that I have already planned to remove. At first it seemed a good idea but often failed when shift was kept pressed. The shortcut that triggers the focus is alt+d btw (Hotkeys).2 points
-
I think "sort" is the sort order of the pages as they appear in the tree, which may be different than the order they appear in the PageTable field.2 points
-
Both of these will find the same pages: $pages->find("show=1")); $pages->find("show.label=CTRL Daily");2 points
-
Add this line somewhere before the RewriteRule directive in Point 19. RewriteCond %{REQUEST_URI} !^/?wordpress(/.*)?$ This pattern tells the rewrite engine to look for the following in the requested URI: ! = negation, this rule succeeds if the match fails ^ = start at beginning of the string /? = look for an optional forward slash followed by the word "wordpress" (/.*)? = optionally followed by a forward slash and arbitrary characters $ = match until the end of the string2 points
-
Yeah, it won't work if you have it in the loop because it will delete the image you added in the last loop. If you simply want to prevent doubling of existing images by filename, you can do something like this whereby you check to see if the image already exists. if(!$product_page->images_product->get("name={$image_name}.jpg")) $product_page->images_product->add($image_path);2 points
-
It's essentially those two libraries: league/csv and league/flysystem (with the FTP adapter).2 points
-
Hi arjen! Yes, I am still using the module but with an old processwire install. I just never published it to the repository. Just send me the pull requests and I will recheck and finally publish the module. I did't find the time to do so when I first did it and then I just forgot. It would be a waste if it works fine and others don't find it.2 points
-
OR-groups should do the trick. template=entrytpl, (parent.id=7077), (id=7077), sort=relatedstuff.release_date, sort=someotehrfield, start=0, limit=1002 points
-
Regarding MarkupSimpleNavigation: You have more options here: http://modules.processwire.com/modules/markup-simple-navigation/ (See Default Options) Including the options to modify the markup of the links: <?php $options = array( ... 'item_tpl' => '<a href="{url}#section{id}">{title}</a>', 'item_current_tpl' => '<a href="{url}#section{id}" class="current">{title}</a>', ... ); echo $treeMenu->render($options, [...], [...]); I also go with @Webrockers method of having the sections of onepagers as childpages of the homepage. (Or they could sit anywhere basically). It is nice because you can have different templates for each kind of section then: "onepager_text, onepager_carousel, onepager_contact". Find them with the selector ("template=onepager_text|onepager_carousel|onepager_contact")2 points
-
Why? Someone might still find it useful in the future. Especially if you edit your original post, fix this line and provide a short explanation. Sure, this thread could be moved to the Dev Talk topic, so perhaps a Moderator can help us out...2 points
-
I use: https://www.keepassx.org/ I would never store my passwords online, however convenient it might be. For similar reasons, online banking with a mobile phone is no way for me, no matter how much my bank pushes it...2 points
-
I spent way too much of my spare time with trying to produce an overly complex site backup module. Anyway - it is here in a pre-release state. I somehow have to get rid of the monster. Features: Use Storage Providers There are two base classes for Storage modules and three reference implementations: Remote Storage Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage. You need to extend all abstract functions: connect, disconnect, upload and getConfigFieldset Implemented Examples Storage Mail Sends a backup as mail attachment. If the file size exceeds a set limit it will get split. It uses PHPMailer library as WireMail does not support attachments. @todo: For now this mails all in a single smtp session - maybe thats not so safe? Remote Directory Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage and list and delete old files. You need to extend all abstract functions: connect, disconnect, upload, find, size, mdate, delete and getConfigFieldset. Implemented Examples Storage FTP Allows to connect to an ftp server and upload, list and delete files. Uses standard php ftp functions. Storage Google Drive Allows to connect to google drive server and upload, list and delete files. Uses the php google api. You have to create a Service account with the google developers console and add the key file to the plugin directory (or another directory if you specify a relative or absolute path to that file). s. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount I don't use the OAuth token process because it is not more secure. Once there is a renew token (which is necessary to avoid user interaction) it is as powerful and insecure as a keyfile. It is just more complex as it needs a callback url for registering. @todo? In case you can prove otherwise I will implement the callback registration. Run from the web or the command line It's allways better to have a regular cron job running. But sometimes you might need webcron Command Line You just need to call backup.php with the id of a backup job and it will be run Web Cron There is a token that starts the backup job from the web if passed as a url parameter. You can specify whether you want logging the http stream or not. You can also specify whether you want a job to be repeated within a certain timespan. This is for using unreliable webcron services by hitting the backup multiple times. @todo Consider integration of cron.pw @todo I use the init function of an automatically loaded module as a hook. This seems a bit strange. Is there better ways to do that? Log to mail, file and admin You can recieve logs by mail (on success or failure), log to a file and see log in a an admin page: Configure I built a admin interface that - besides the log viewer - features a list of jobs: and an editor for the job (which is too extensive to be described in detail): Dicussion I am not too sure on how to solve the issues indicated with @todo. My main concern are the hooking (init of an autoload module for the moment) and locking (none, no singleton for the moment). As for hooking I only know of the alternative of using a page where one would have (afaik) to use a special template as the admin template is secured or hook into the security functions (which would probably call for a singleton module). Concerning the locking issue I think it might be good if the Admin Class would lock if it is updateing something. For the moment this is the same class that runs the backups thus it would also lock the admin if there is a backup running. And it would lock the whole site if it is on autoload (as I use the init hook). Lastly I should reconsider the logging and maybe try to better integrate it with processwire logging. I would appreciate comments and suggestionsn on these issues. I appreciate your test results. Don't be took frutsrated if something goes wrong, this is at an early stage but afaik it should be running. Please find the modulle on: https://github.com/romanseidl/remote-backup1 point
-
New master and dev versions released, more coverage of what you can do with the new Functions API, plus a couple useful tips and tricks. https://processwire.com/blog/posts/processwire-3.0.40-core-updates/1 point
-
1 point
-
1 point
-
1 point
-
I think page sorting could sport a more intuitive api like insertAfter/insertBefore/insertAt. But it seems currently most of the sorting stuff is hidden away in ProcessPageSort.1 point
-
Looking at the filter box, I am not sure it should be automatically focused. While this might seem nice, it removes the search icon, so it's actually hard to know what the input field is actually for. This is probably most important when editing a page with a Profields Table field on it. As a site editor I am not sure I'd know what to do with that input box. Also, on the issue of Table fields, if you have more than one on a page, the filter box filters all the fields. I am actually thinking that it might be best to remove the filter box altogether for Table fields because the latest version supports pagination and has its own filter functionality that works via ajax across all paginations, which of course your filter box doesn't do. The same could actually be said for for Listers - is there much point having the filter box when it only filters the current page of results?1 point
-
Definitely. I was looking for something else in the forum and stumbled upon your module. It does exactly what another backup script (PHPBU) is doing, but now from within the admin panel.1 point
-
1 point
-
1 point
-
I tried it on both Firefox and Chrome and got the same result. But then I discovered it's caused by the LastPass extension that I have installed on both. If I log out of LastPass it works normally, so problem solved. Thanks.1 point
-
1 point
-
Hey @tpr - along the same lines as what @Juergen just said, I must admit I haven't really had time to play with this in a while, but taking a look again now, and I have to say I am very impressed - it is looking really fantastic these days! One quick question - I am only seeing the filter box for the module page - I don't see it for BCE, or other locations where I would expect it. Is there something I need to specifically turn on. I found the Miscellaneous tweaks option which turned it on! Just an FYI - I still prefer the default theme over the Reno theme - I have a list of issues with the Reno theme that have held me back from using it. This is something I compiled a while ago, so please forgive me if some are no longer correct. I thought there might be some inspiration here for you, but if it's just me that is bugged by these, please ignore Many of these should probably be fixes to the core, so ignore those also. There are currently no icons for module submenus. I think it would be preferable if the submenu pane started at the vertical position of the menu that it is triggered from so long as all items fit within the remaining screen height below the main menu item. It is currently quite annoying for modules which only have a couple/few items to have to move to the top of the page to select a submenu item. Not sure if it's intentional or not, but if you close the submenu/lightning pane and then hover over the lightning icon for the same main menu item again, the pane won't load - you now have to click to make it open. Inconsistently in breadcrumbs between current default theme and Reno - see my note here: https://processwire.com/talk/topic/11550-feature-request-ability-click-current-page-in-the-breadcrumbs/?p=111470 Is there a reason that the search box ends up in the middle of the page, even though it is triggered by clicking on a button on the right? If you want to close it you now have to move your mouse from far right to the middle - might not seem like a big thing, but it just seems a little cumbersome to me. The lightning icon for the "Support Forums" and other items doesn't make sense to me - I don't think it should be the same icon as is used in the main menu. What about a chain/link icon as they are all links to info/resources. Maybe even an "info" icon? I'd also love to see an easy way to replace the PW logo image at the top left for a company logo. I don't want to diminish the advertising benefit to PW, but also think that some customers need to see something more personal. On this note, I'd also love to see easy skinning - like Blad's module When you have debug mode on there is a FOUC with the debug mode tools content before it gets collapsed - quite annoying IMO. The lightning submenus don't expand to the width of the widest entry, so for some modules the name is truncated. The lightning submenu panel for site modules doesn't let me scroll all the way to the bottom so I can't get to all the modules. The down expand arrow on the main menu items should perhaps start as right facing and become down facing once the item has been expanded. I think the menu would benefit from a more obvious divide between main items (or highlighting of the main items). When you have multiple main items expanded it can be difficult to quickly see each of the main (top level) items. I am really not sure I see the point to the side menu as it currently is. For most site editors, the only thing they see in that side menu is "Pages". It looks weird and like a huge waste of space. I know you can collapse the side menu, but I think we can do better. I mention a bit about my thoughts here: https://processwire.com/talk/topic/4398-two-column-admin-theme-concept/?p=112450 - In particular I would like to see the Setup, Modules, Access items in a top menu and have the page tree in the left side menu. Maybe page editing could be ajax loaded from the tree, but I think to keep things simple it would be fine to simply render the page list tree in that side menu and have the edit links load the edit link for the page, and open the page tree to the page being edited. If you have the Children tab selected when saving a page, once the page reloads, the ajax call to populate the children tab is not triggered. Clicking on another tab and then back to Children loads everything - update - I think this actually affects the default theme as well these days - anyone else?1 point
-
v0993 is up, incorporating bernhard's suggestions, including the github readme link and jumplinks to each submodule's configuration fields in the submodule "panels": The latest PW dev (3.0.40) has changes in some CSS classses (dropdown -> pw-dropdown) and AOS was adjusted for this. If you find that somewhere it's not working as it should, please report.1 point
-
Sorry for the delay -- meant to answer a while ago, but then something came up, and I forgot the whole thing. Hopefully you haven't been waiting this whole time I'm going to answer your suggestion at the Changelog support thread separately, but as a quick comment to this: I think your module looks really neat, and while listing changes to fields is definitely something I might consider for Changelog, I do also feel that these modules serve a different purpose. At least that's my first impression. When I first built the Changelog module, it was just a simple list of changes to public pages of the site. While it does display which fields were changed and now also includes system pages, I've intentionally left actual field values out of the equation. That's where VersionControl comes in: it stores field values and keeps track of changes to those. Again, the purpose is different: a relatively high-level log of changes vs. an actual versioning tool. Tracking changes to fields might fit VersionControl better than Changelog, but I'm currently not convinced that it would really be worth it. It seems to me that while there may be some common ground, these are mostly separate features. And, to be honest, VersionControl is already doing so much behind the scenes that I'm having hard time keeping up with everything that's happening. Smaller, more targeted modules do have certain benefits I'm definitely going to keep an eye out for what you do with this module, but for the time being I don't think there's much benefit in trying to combine them. --- By the way, I've been meaning to ask you about the naming of your module: what does the SVN part actually refer to? My first guess would be Subversion (SVN), but then again, I don't see any link between Subversion and your module. Hopefully I'm not being too intrusive here, but if my guess is right, I'd suggest reconsidering the naming. While Subversion is a commonly used product, in the long run this might become a bit confusing to some users1 point
-
1 point
-
I was wrong about the bug in PageTable - I misinterpreted what the purpose of the 'reloaded' event was. So unfortunately there's no event that's guaranteed to trigger when the inputfield does an AJAX reload. Instead we have to check the PageTable field with every ajaxComplete(). But that's not actually a bad thing because we want the check to fire if the PageTable was inside an AJAX loaded field. If you placed a modified InputfieldPageTable in /site/modules/ please remove this and install LimitPageTable v0.0.2: LimitPageTable.zip 1. This is straightforward - in "Table fields to display in admin" just use template.label instead of template, and change the module to match against tpl_label: return $(this).text() == tpl_label; I considered making this the default for the module but I don't like the header given to the table column when this option is set. 2. Not sure what you mean here - the button is disabled in the PageTable field, isn't it?1 point
-
1 point
-
When you're on a development system, enable display_errors and html_errors and set error_reporting to E_ALL in php.ini. This way, you'll get a sensible output for most errors. If you still end up with an internal server error and your http server's error log isn't cluing you in, you can try bootstrapping PW from the command line and rendering the page that causes the error from there. <?php // Needs to reside in PW's main directory where index.php is, otherwise // the path to index.php needs to be passed to include(). include('index.php'); echo $pages->get('/your/faulty/page/')->render(); In your example, you use the Page::render function. Admittedly, it's a bit unfortunate that there isn't a more detailed description linked in the 3.x API docs for $page/Page. The (optional) first argument to that function is either the name of a field on the page (in which case it searches for a field template with a matching name) or the name / path (relative to the templates directory) of the PHP template to use. The '/' you pass here apparently doesn't do what you think. <?php $contact = $pages->get('/contact/'); /* retrieve contact page*/ // Renders output using the template file assigned in the backend // that $contact uses: $contactRendered = $contact->render(); // Or: use a different PHP file than the template's default, // relative to site/templates. This call will look for a PHP // template site/templates/contact_simple.php $contactRendered = $contact->render('contact_simple.php'); echo $contactRendered; /* output rendered contact page here */ ?> One little thing that makes development infinitely easier in the long run is to always be as explicit as possible when you name your variables. Try to avoid generic names like $getPages (unless you're really writing a generic function that deals with all kinds of pages), make them descriptive about what they contain and let singular and plurals forms tell you whether they hold a single instance or multiple. I've adapted the snippet of code accordingly.1 point
-
Anyone looking for some contract work? I have a few projects that I need help with. I have 8 upcoming projects (PW dev only) that need to be implemented. I would do all design and HTML/CSS. most of these are small to mid size sites with 5-10 templates. I would love to work with someone that wants to do a bunch of on-going contract work. I always have work . I am looking for someone that can write PW modules, is familiar with the PW way of doing things – and is completely happy with that. I have an existing project - PW site that I need some expert help on with the following features: tracking users actions & information on the site - saving to user profile. some FormBuilder integrations User favorites and recently viewed. adding some google charts to the admin backend - like a dashboard for some of the information we are collecting. making the admin/data easier to use for the clients. (organizational. I don't want to change PW at all) If you PM me, I can show you the site. I just don't want this forum post to get indexed by google if I put the URL or name.1 point
-
$designers_person = $pages->find("parent=/designers/, designers_lastname!=''")->each(function($designer){ $designer->custom_sort = $designer->designers_lastname; }); $designers_group = $pages->find("parent=/designers/, designers_lastname=''")->each(function($collective){ $collective->custom_sort = $collective->title; });; $all = $designers_person->add($designers_group)->sort('custom_sort');1 point
-
Don't know if it was only my data but when using a checkbox fieldtype, the checkbox was checked even if the value was 0 so needed to go through all pages to uncheck those that shouldn't be checked. However, added the 'FieldtypeOptions' and it worked perfectly by having the correct value selected. Also, as other mentioned, would be nice to have the module support multi-language site. If the French title could be populated at the same time as the English title with also the status checked, it would help enormously. This also goes for the PageActionExportCSV module to be able to export at the same time the English and French title.1 point
-
1and1 check your htaccess I know this problem there # RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/ change to RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/1 point
-
I posted a similar topic that might be relevant to this discussion. https://processwire.com/talk/topic/11905-globally-access-the-page-tree-in-the-admin-theme/ I like how wagtail.io has a sliding page tree.1 point
-
New in version 3.0 Removes the limitations of the previous releases! Now compatible with all Inputfield types including Select, SelectMultiple, Checkboxes, Radios, AsmSelect, PageListSelect, PageListSelectMultiple, and PageAutocomplete. When using the create new page feature, new pages are added to the field and selected automatically as soon as the modal is closed. No further input is required from the user. The "View" and "+ New" strings are now translatable The add new page links may be enabled independent of the view/edit links Code performance improvements GitHub: https://github.com/thetuningspoon/AdminPageFieldEditLinks Direct Download: https://github.com/thetuningspoon/AdminPageFieldEditLinks/archive/master.zip I ended up using a combination of different methods for populating the field with the new page once it's created. Some of the input types were fairly easy and could be updated without reloading the field, while others required some pretty wild code acrobatics, taking advantage of Ryan's new AJAX reload and repopulating the input with pages that were already selected but not yet saved. Please let me know if you run into any bugs. This was built mainly in Chrome with limited testing outside of it so far, so I expect some issues. I hope you guys enjoy the new features! Let me know if you have other suggestions for further enhancements.1 point
-
Dear all, I know this post is old, but in case someone else stumbles across it, here is a modified version of Soma's getLabel() hook which takes an optional second parameter to decide if you want a fallback to the default language if no localized name of that field is available: $fields->addHook("getLabel", null, "getLabelLang"); function getLabelLang($event){ $field = $event->arguments(0); $fallback = $event->arguments(1) === null ? true : $event->arguments(1); $lang = wire("user")->language->isDefault() ? "" : wire("user")->language->id; $field = wire("fields")->get($field); $caption = $field->get("label$lang"); $caption = (count($caption) === 0 && $fallback) ? $field->get("label") : $caption; $event->return = $caption; } Usage: $fields->getLabel("labelName"); -> returns the localized label name with fallback to default language. $fields->getLabel("labelName", false); -> returns the label name without fallback to default language. I am not very good with php, any code improvements welcome!1 point
-
Thank to everybody for your support! At the end Nico suggestion's worked like a charm and luckily I have no security limitations on the server. I report here the code I finally use and I hope this could be useful to someone else // fetch the json displayed on the service page $dataJson = file_get_contents('http://www.serviceurl.com/service-pages/?parent=1145'); // transform it into a php array $items = json_decode($dataJson, true); foreach ($items['matches'] as $item) { // start the looping. "matches" is the name of the results array generated by the webservice echo $item['title']; echo $item['body']; echo 'http://www.myurl.com/site/assets/files/' . $item['id'].'/'.$item['myimage']['basename']; // url image } If you need to pass an image, the last line rebuild the url and Insted of www.myurl.com and [myimage] field you have to write your own and than you can use in an img tag.1 point
-
Maybe we can make the base color adjustable. A single line of CSS or a line in $config. Here are the only PW blue, green or black versions: I wouldn't make the topic more complicated than it is. We can right now customize the admin theme and write modules. This discussion is good, because we ould create some interessting ideas for future modules - build for the backend of PW. The idea of a blank admin theme is great. This could be layed out as a kit to develop your own admin theme. (In addition, PW could ship with a theme created on top of this blank master).1 point
-
1 point