Jump to content

kunago

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

kunago's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

  1. I followed the steps to use multiple-site in Processwire: https://processwire.com/docs/more/multi-site-support/ It works excellent but has issue with translations. It is easy to clone a production site to a dev site, simply duplicating the "site" dir to a "site-dev" dir. Then one needs to clone a database and that is it. Except for one thing - translations. Those are stored in assets/files/<language_id> with file names including the "site" (presuming I cloned the "site" dir). That can be for instance "site--templates--content--home-php.json". While working with the production site, everything looks great; once I use the dev site, I need to rename these files manually to "site-dev--templates--content--home-php.json" so Processwire can pick up the translation. I also noticed this while looking at the translations: The "-dev" at the beginning. Maybe trimming that would be more readable? I am not sure what solution would be the best here. Maybe having some variable in the LanguageSupport module that would allow ProcessWire to look for translation files with a different "site" name? Or a batch rename as the "site-" is always obligatory in order to use multiple-site feature? Maybe I missed someting though and there already is a setting for this though.
  2. Thank you for help. The "getInfo" method is useful. I found out where the issue was and "tomorrow" is a the easiest way to go here.
  3. Hi and thank you, @BillH. My aim is this: if the cache value has not expired,use the cached value if it has expired or does not exist, set the cache value and either set the expiration value as integer which then saves the value for eg. 3600 seconds set the expiration value as date and time which would be the latest date and time this value can be used before it expires That's how I understood the cache->get method. The problem here is the "expire at midnight" part because I have quite a few content, such as news, which expire daily. There is no need to check it hourly but having it expire daily means in 86400 seconds, which can be quite late after that midnight timestamp.
  4. I am trying to work with caching for the first time and I seem to struggle with the cache expiration time. As I was able to find out in the manual, I can either "Optionally specify max age (in seconds) OR oldest date string." The max age is fairly easy, there are examples so that's fine. I kind of seem to fail though with the date. I set up a few variables I use for caching: upcoming midnight (empty cache on midnight) next Sunday midnight (empty cache on Sunday at midnight) last day of the month midnight (empty cache at the end of month) etc. I think I saw "strtotime" in the code so I am using this for midnight $midnight = date("Y-m-d 23:59:59") which I pass as the expire argument. It does not seem to work though and the cache variable did not really refresh by midnight. I have all other caching disabled, only trying to use the $cache API variable as of now. Could someone give me hint here what might be wrong with it?
  5. I would like to ask for some help or maybe hints how to solve issue with caching. I love how easy it is to build a website with ProcessWire. Now as it is done, I am trying to step onto performance. The performance by itself is good already according to Google for instance but I need to apply some caching which I did try in the past in different projects but usually dropped it later because of problems. This is the site, just for the reference: https://www.breclove.cz I have 11 templates altogether. One template does not have a template file so it is there just to organize other pages and one is purely for administration of the website visible to superadmin. The need is to cache publicly acessible templates of course. So I took for instance the "home" template and set caching for 3600 seconds and enabled caching for guests only (see pic). The page does cache fine but when testing with Google Insights I found out it cached more than needed. I am using front-page edit which was cached as well for guests. What is more, I also have a special menu item in the main menu visible only when logged in and that menu item was visible and cached as well. The template caching cached the logged template output, not what guests should see. Except for ProcesWire caching I also use AIOM+ but only to aggregate CSS and JS files to reduce amount of requests and to compress HTML, little would that be likely a related issue. No other caching has been applied yet. Thank you for any hints or ways to debug this.
  6. @kongondo, thank you for your reply. I need to start working on it rather sooner then later so at this point it's hard to pick - whether a different solution or to wait. Since I don't think it is a good idea to work with Padloper 1 and then with some difficulties migrate to Padloper 2 .... ummm. I need to think it through. 🙂 Thank you though.
  7. Hi @kongondo, I am in the need to create an eshop. I think you wrote quite a lot about how hard you work on Padloper. I cannot imagine how far you can be with it. In case I buy a licence now, will I be able to upgrade later or should I wait for the new version? Thanks.
  8. I have a question concerning the documentation which I use pretty much always when doing some work with ProcessWire. Fantastic progress is being made with every update but I just ran into some information in forums or in blog posts and often only by coincidence. What I can think of right now includes these: in selectors there can be used words like "today" and "tomorrow" (I found the tomorrow in one forum post) in selectors and for repeaters I can use "owner" to find the parent node for image fields there are possibilities to create any field types to be used along, instead of the previous description fields only I can imagine these are just a few examples and some things may not be well known to normal users like myself. Is there a list of such "news" that have not made it into the documentation yet? Or am I missing some pages where this is already documented?
  9. Thanks a lot! This is a super easy solution. I don't want to let the user change the aspect ratio and this does it just well. Excellent job. Thank you again.
  10. Yes, for multilanguage. Sorry, bad explanation.
  11. That's great. I implemented it in the meantime. It was very easy, took no time at all. Great, seriously. Just a side question - is there a way to translate the name of the crop preset?
  12. Hello again (by the way I really love ProcessWire), I am attaching a screenshot. Let's say I have that wide image but I need to crop an image in ration 3:1 (for example 900x300 px). I cannot force the highlight to stick to the needed ratio and resize proportionally. I am not sure the CroppableImage3 module can handle this as I looked at the description but thank you for the suggestion.
  13. I am using the integrated image field type with the possibility to crop images. It is an excellent feature. For one project I am trying to work with some images that need to be cropped with a fixed aspect ration, for instance 1:2. I can do the same in PHP but that does not show the user what will be the result before the image is saved and viewed. Also it is quite difficult for some to prepare images according to the aspect ratio required so nothing needed is cropped actually. I look at cropper that is a part of the ProcessPageEditImageSelect module. Cropper does have the possibility to set the aspect ratio but it is not used in the module itself. Is there any programatical way to force the cropper to use a specific aspect ratio without any need to mess around with core modules?
×
×
  • Create New...