-
Posts
1,331 -
Joined
-
Last visited
-
Days Won
61
Everything posted by BitPoet
-
Just use httpUrl instead of url.
-
Unable to edit links in CKeditor getting 403 error
BitPoet replied to jsantari's topic in General Support
Inexplicable 403 errors in CKEditor's dialogs are 99% of the time caused by apache's mod_security. -
Replace the fuel() call with wire('all') or wire('*') should get it working in 3.0, as LostKobrakai pointed out in this thread.
-
Both "manufacturer=$optiontitle" and "manufacturer.title=$optiontitle" should work, unless you have separate values/titles configured and want to search for the value, then "manufacturer.value=$optionvalue" is the way to go. Both .value and .title support text matching.
-
How to get page title of other languages ?
BitPoet replied to adrianmak's topic in Multi-Language Support
@adrianmak, is it just a copy&paste mistake that your code accesses $category while you set outputFormatting to false on $page? @gebeer: Additionally, there are two other methods to get a page field's value in another language (with the first one being my favorite): // 1. Directly from the page: $title_en = $category->getLanguageValue($eng, 'title'); // 2. A bit more circumspect: $titleField = $category->getUnformatted('title'); $title_en = $titleField->getLanguageValue($eng); -
-
2500 queries for a single pageview? Is that normal?
BitPoet replied to pleini's topic in General Support
While 2500 queries per page load is quite a bit, it isn't completely unheard of for a complex multi-language site (though it cries for a bit of caching). Two connection per view is normal. The SQL_NO_CACHE keyword is only added if $config->dbCache is disabled, which is enabled by default, and this definitely puts a heavy load on the server (data for every query has to fetched anew). So I'd enable dbCache in site/config.php again and test if the problem is still present, then also make sure that $config->debug is disabled for the live site. -
foreach($grandparent->find("template=product") as $product) { ... } should do the trick.
-
Update: I've added a "Media" admin page with a quick create option for new library pages.
-
I don't think checking it by default would be sensible. Usually, access is managed by template permissions and hidden/published status on the selectable pages. Any widening of access rights should have to be done explicitly.
-
There's a point though. Perhaps a ISO language code dropdown could be added to the language template together with a checkbox to allow automatic installation of language packs by new modules according to the selected value. This would keep backwards compatiblity yet allow for automatic installation (through module install). Adding a mechanism to query installed modules whether they provide translation packages for newly added languages could be accomplished by hooking Languages::added. The only problem I see are languages that differ quite a bit in ISO 639-1 groups, which, for example, captures all variants of Chinese under the lable zh. Yet ISO 639-3 may be too fine-grained. A two-part solution like Unix and Windows use would IMHO be better (e.g. zh-cn, de-de, with fallback to the first two letters).
- 4 replies
-
- 1
-
-
- module
- translation
-
(and 1 more)
Tagged with:
-
The api runs as the logged-in user, or as guest if you're not logged in.
-
Can you make sure it isn't a permissions issue (e.g. /styles/base/black being hidden)?
-
#1) For debugging purposes it would be good if you could also show us the rendered line 7. #2) The #-Links are probably added by the slider. Are you using a PW module or a third party library to generate your slider?
-
Try wire('fields')
-
Creating a slideshow and grabbing each child with image field
BitPoet replied to Danjuan's topic in General Support
Make sure your hero_image field is set to "Single item". -
I don't think any changed wording will completely solve the problem of people leaving out vital details, but the line in question could be easily ammended to include the PHP keyword: Easy-to-use, jQuery-style API for PHP
-
Yes, there's obviously a danger to add too many files to a library and make things convoluted. There's a point where simple dropdowns aren't practical anymore, but then, structuring information always is an ongoing task. That's a reason why one of the next points on my todo-list at work is a small module to show file usage (i.e. which pages' html fields link to a given pagefile), though that's probably going to be less pratical as I'll use a custom link and image url extractor in our OpenSearchServer to get quick results and avoid parsing multiple fields in a few thousand pages in the database for every file. I haven't read that book, but getting acquainted with tool sets and release procedures before forming bad habits sounds like a good plan, even if not everything (like e.g. composer use) can be used for every project. It's often harder to un-learn a bad habit than learn it the right way first.
-
I don't want to dig too deeply into circumventing PW's default behavior, so doing things in steps is the way to go for me. This way, I can use PW's default behavior in a lot of places. As for lots of images, it's the same as if they were added to the page itself, so with enough images the pwimage dialog will get sluggish (when depends on the client machine). While it doesn't scale infinitely, it should work in most common scenarios. The file links scale better performance wise, as only one is previewed at a time, though there's definitely a limit too when editing the library pages themselves. It can be a sub page of any ancestor, so a child of a "grandparent" or higher up works too. I'll probably not add much functionality besides what is already there in the short run. I see where you're heading, but that would be counter-productive to what I'm trying to accomplish (at least, where I'm planning to use it). I'll keep the idea in mind, and I won't rule out implementing it if a short, clean solution jumps my mind, but I've got too many other things already on the backburner. If you or somebody else uses my code to as a building block for something like this, you're welcome though.
-
My primary application will be for our intranet site where we have complex product datasheets and configuration information that link to parts sheets, supplier information, technical standards and whatnot. Keeping linked documents up-to-date is quite important, and with today's innovation speed we've got about twenty to thirty doc updates per workday. I'll probably keep creation rights for the MediaLibrary template limit to admins though, to avoid over-eager users cluttering every page with a media child (just in case...).
-
MediaLibrary Update: MediaLibrary can now be found in the official module list. Out of necessity, I've started to implement a simple media library module. The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree. The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality. I've put the code onto github. This module is compatible with ProcessWire 3. Steps to usage: Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look. Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple. There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section). Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library. Edit 01.05.2016: Version 0.0.8: - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker). - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries. - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries. Edit 10.10.2018: Version 0.1.3: - Dropped compatibility for ProcessWire legacy versions by adding namespaces - Allow deletion of libraries from the Media overview admin page - Added an option to hide media libraries from the page tree (optionally also for superusers)
- 68 replies
-
- 23
-
-
Update: thanks to LostKobrakai's prompting, I've looked at delayed operation and implemented a mix of immediate and delayed updates. This is a major change, so the code is still in alpha and available in the dev branch at github (there are also some screenshots to be found in the readme). I've incorporated an admin page where pending updates can be seen and triggered, but the whole thing is still lacking permissions checks (both for visibility of the admin page and for listing viewable/editable pages), which may require some big changes to the code (perhaps even split hooks and update functionality into separate modules). Of course, if that happens, I'll make sure updating works. Every page clone now stores a todo entry in the database. When cloning a page, URL updates are triggered after the last page has been cloned and at most 50 pages are updated (configurable in module settings). The rest of the updates have to be triggered manually in the admin page (for now). So if anybody wants to give it a try, I'd love to get some feedback.