-
Posts
10,912 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
There is also: https://github.com/ryancramerdesign/ServicePages Also read from here (https://processwire.com/talk/topic/1654-pages-web-service-servicepages/?do=findComment&comment=132839) onwards to get it working with PW 3.x
-
Glad you like it Perhaps you'd consider adding your support to my feature request: https://github.com/processwire/processwire-requests/issues/54 As far as I can tell there is no way for me to control which languages are displayed at the moment. If Ryan can come up with a core solution that lets me hook and change the results returned by $languages then I think I will be able to incorporate your request into this module. My goal is to have a checkboxes field added to the page edit Settings tab that lets you determine which languages are enabled for the page/branch.
-
If you look at Example #2 : https://processwire.com/api/modules/markup-pager-nav/ you can see how to output pagination links exactly how you want.
- 3 replies
-
- 2
-
- pagination
- style
-
(and 1 more)
Tagged with:
-
Hi everyone, @Christophe was kind enough to notice that I had mis-spelled "Language" throughout the module, including the name of the repo on Github and the class name. I think I have everything updated correctly now, so if anyone has already installed it, you will unfortunately need to install again. Sorry about that!
-
Check out the new module for this functionality:
-
Hi everyone, Here's a new module that lets you control whether multi-language support is enabled at the page / branch level, rather than only per template. http://modules.processwire.com/modules/restrict-multi-language-branch/ https://github.com/adrianbj/RestrictMultiLanguageBranch This is ideal for a site with repeated branches using the same templates where only some need to be multi-language. I think it is confusing to provide multiple language inputs for fields when they are not required - it just bloats the admin interface for site editors. I am hoping to expand this module to allow selection of which languages are supported per page/branch, but I am waiting on @ryan's response to this request: https://github.com/processwire/processwire-requests/issues/54 - to me this would be even more powerful if you have a situation where certain branches need some languages and other branches need different languages. The module config settings shows a summary of the restrictions you have implemented, eg: This shows that we have started with the home page which disables multi-language on itself and all its children/grandchildren (because "This Page Only" is "False". Next we have the /report-cards/ page multi-language enabled, but no inheritance (because "This Page Only" is "True"). The only branch below this to have multi-language enabled is Guanabara Bay and all it's children etc will also be enabled. All other report card branches will be disabled because they will inherit directly from the config settings default status. The Settings tab for each page gives you three options: Inherit, Enabled, Disabled. The screenshots give you an idea of how the Inherit option works and the information it provides based on the status it is inheriting and from where. My goal for this site was to just enable multi-language support for the Guanabara Bay report card branch of the tree, as well as the home page and the /report-cards/ parent. All other branches have multi-language support disabled which makes content entry much cleaner. Hope you guys find a good use for it and I'll be sure to update with the ability to define which languages are available on which pages/branches if Ryan comes up with a core solution for changing the returned $languages. Please let me know if you have any problems / suggestions.
- 29 replies
-
- 19
-
That doesn't seem to work for me - tested on default and reno. Also, please note that I expanded on the icons issues with the default theme in my last post - the "Always show page list actions" doesn't work for the parent of expanded branches on Default Admin Theme - works fine with Reno.
-
Thanks @tpr - unfortunately that still doesn't fix the Page IDs issue for me. Here's the generated source of one of this pages in the list. As you can see there is no <span> to start with, which is why that version I posted (https://processwire.com/talk/topic/13389-adminonsteroids/?do=findComment&comment=133085) adds the span. Maybe it's not the best approach, but unfortunately it doesn't work as is. <div class="PageListItem PageListTemplate_course PageListID1016 trashable"><a href="#" title="/rock-climbing/introduction-to-rock-climbing-rappelling/" class="PageListPage label">Introduction to Rock Climbing & Rappelling</a><span class="PageListNumChildren detail"></span><ul class="PageListActions actions"><li class="PageListActionEdit"><a href="/admin/page/edit/?id=1016" class="pw-modal pw-modal-large pw-modal-longclick" data-buttons="#ProcessPageEdit > .Inputfields > .InputfieldSubmit .ui-button">Edit</a></li><li class="PageListActionView"><a href="http://sradev.skaharockclimbing.com/rock-climbing/introduction-to-rock-climbing-rappelling/" class="pw-modal pw-modal-large pw-modal-longclick">View</a></li><li class="PageListActionMove"><a href="#">Move</a></li><li class="PageListActionEdit"><a href="http://sradev.skaharockclimbing.com/admin/setup/template/edit?id=44" class="pw-modal pw-modal-large pw-modal-longclick" data-buttons="#ProcessPageEdit > .Inputfields > .InputfieldSubmit .ui-button">course</a></li><li class="PageListActionExtras ui-priority-secondary"><a href="#" class="clickExtras"><i class="fa fa-angle-right fa-flip-horizontal"></i></a></li><li class="PageListActionExtra PageListActionUnpublish"><a class="PageListActionExtra PageListActionUnpublish" href="/admin/page/?action=unpub&id=1016" style="display: inline-block;">Unpub</a></li><li class="PageListActionExtra PageListActionHide"><a class="PageListActionExtra PageListActionHide" href="/admin/page/?action=hide&id=1016" style="display: inline-block;">Hide</a></li><li class="PageListActionExtra PageListActionLock"><a class="PageListActionExtra PageListActionLock" href="/admin/page/?action=lock&id=1016" style="display: inline-block;">Lock</a></li><li class="PageListActionExtra PageListActionDelete aos"><a class="PageListActionExtra PageListActionDelete aos" href="/admin/page/?action=delete&id=1016" style="display: inline-block;">Delete</a></li><li class="PageListActionExtra PageListActionTrash"><a class="PageListActionExtra PageListActionTrash" href="/admin/page/?action=trash&id=1016" style="display: inline-block;"><i class="fa fa-trash-o"></i> Trash</a></li></ul></div> One small request with the new icon page list actions - can we get title attributes so users can figure out what they are until they get used to them? Also, the "Always show page list actions" doesn't work for the parent of expanded branches (only tested on Default Admin Theme). Thanks heaps!
-
Firstly, try this module instead: http://modules.processwire.com/modules/markup-rssenhanced/ Secondly, don't edit lines in the module, try passing the options array to the render method so that updates to the module won't break the functionality.
-
[solved] Can I pass a variable to a hook function?
adrian replied to Robin S's topic in API & Templates
You can use $this->animal $this->animal = 'cat'; $this->addHookAfter('Page::render', function($event) { bd($this->animal); }); or you can also do this: $animal = 'cat'; $this->addHookAfter('Page::render', function($event) use($animal) { bd($animal); }); -
Any chance your map and address fields are in a fieldsettab? I have a setup like that and just tested with AdminCustomFiles and this works: $(document).on('wiretabclick', function () { Of course that will only work if the tab that the map is on is not the one initially loaded. Sorry, I don't have time to investigate right now, but keep in mind that you'll need to deal with the scenario when the tab is loaded open first, like after a page save. Maybe you are not using tabs, but it certainly shows the issue of that jquery being applied before the form elements exist.
-
If everything works with that JS entered into your browser dev tools console, and the basic-page.js is loaded, then it's likely that the script is being called before the page's input fields are ready. Try wrapping it so it looks like this: (function ($) { $('#Inputfield_city').on( "blur", function() { var address = $('#Inputfield_street').val() + ', ' + $('#Inputfield_city').val(); $('#Inputfield_location').val(address); $('#Inputfield_location').blur(); }); }(jQuery));
-
It would be simple to make it only grab the first page: https://github.com/adrianbj/ProcessPDFImageCreator/blob/12a402175c39b506d49497d201f79bd8db6313ef/ProcessPDFImageCreator.module#L138-L140 Replace with: $this->createPdfImage($page, $image_field, $pdf_field_name, 0); I don't know if it will work in a repeater - I haven't tested, but I expect it will need some tweaks to reference the actual page correctly.
-
If you ever have this situation again, it's fairly easy to delete a module via the database. Deleting a field is also possible although there are some more things to consider. I just took a look at that module and it definitely will need some tweaking to get working with PW 3 because of it's use of namespaces and the way extends just certain fieldtype classes in PW, rather than Wire or WireData. I do know for certain that my old module (linked to above) works on PW 3 - I am using it on several sites. It is definitely less polished, but it gets the job done
-
For modules not in the modules directory and not on Github I always update by doing: Modules > Site > Add New > Add Modules From Upload That will also update an existing module. To me that is easier than unzipping and replacing folder.
-
Thanks for that @tpr - I hadn't really noticed that option since I started doing multi-language sites just recently. The nice thing about that is that you can set that $page->template->noLang = 1; at runtime which means you can add some logic in your site ready.php file to determine which pages have multi-language fields enabled/disabled. Here is a quick idea that disables all multi-language fields on the branch that with the parent of ID: 1111 $p = $pages->get((int)$input->get->id); if($p->parents("id=1111")->count()>0 || $p->id === 1111) { $p->template->noLang = 1; } Now what I would actually like to do is control which languages are available in on a per branch basis - so I have this request in: https://github.com/processwire/processwire-requests/issues/54 and also here are my initial ideas around this:
-
The ML version is a different Inputfieldtype - I don't see any changes in 3.x/2.8 that make it possible to override that on a per template basis. ML is not my forte, so I am sure someone will correct me if I am wrong.
-
Is this what you are looking for: foreach ($categ_team as $categ) { $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; //MSc, stagiaire $years = $page->find("template=member, featured=0, categ_team=$categ"); foreach ($years as $y){ if($y !== $currentYear) $content .= "<h3>{$y->date_begin}</h3>";//les années $member = $page->find("template=member, featured=0, date_begin={$y->date_begin}, categ_team=$categ"); foreach($member as $m) { $content .= "<h4><a href='{$m->url}'>{$m->title}</a></h4>"; //nom de l'étudiant } $currentYear = $y; } }
-
Another, maybe better, approach would be to use AdminCustomFiles (http://modules.processwire.com/modules/admin-custom-files/) to add some custom JS to do this on-the-fly. Then use jQuery to grab the contents of your street and city fields, concatenate them, insert them into the map address field and then blur so that google maps triggers a geocode. Maybe something like this: $('#Inputfield_city').on( "blur", function() { var address = $('#Inputfield_street_address').val() + ' ' + $('#Inputfield_city').val(); $('#Inputfield_map').val(address); $('#Inputfield_map').blur(); }); On limited testing here it seems to work just fine. Of course it assumes the address field is named "street_address" and the city field is "city" and the mapmarker field is simply "map". Let me know if that works for you. Don't forget that you can test via your dev console so you know it's working before adding via Admin Custom Files. PS - of course you can always add commas, and even state and country elements to the address that goes into the map address field for geocoding.
-
@Robin S you're a man of no limits these days! Btw, what is that text from
-
Any ideas why this page is responding the way it is? http://knowledge4foot.eu/inga3d/admin Is that some debugging attempt that is still in place?
-
I have not permission to watch my photos
adrian replied to franciccio-ITALIANO's topic in Getting Started
Those permissions are likely the problem. Take a read here: https://processwire.com/docs/security/file-permissions/ -
That first module is marked in the modules directory as being compatible with PW 3.x - what errors are you getting with it?
-
Events Fieldtype & Inputfield (How to make a table Fieldtype/Inputfield)
adrian replied to ryan's topic in Modules/Plugins
I would suggest taking a look at Profields Table (http://processwire.com/api/modules/profields/table/) which now supports pagination. Actually, technically it is the PW core that now supports it and the Table field is the first to implement it. So technically you could add it to this custom Events fieldtype, but the Table field would make your life much easier. -
Use this module: http://modules.processwire.com/modules/fieldtype-pdf/ Or if you want to make images of all pages in the PDF, then try this one: https://github.com/adrianbj/ProcessPDFImageCreator Keep in mind that creating images from PDF files requires that Ghostscript is compiled into Imagemagick. Also, if you are uploading PDFs created for print (ie in CMYK), then you should read this: http://www.lassosoft.com/CMYK-Colour-Matching-with-ImageMagick so that you can get better color matching - otherwise the images will look washed out.