Jump to content

u-nikos

Members
  • Content Count

    38
  • Joined

  • Last visited

Everything posted by u-nikos

  1. Thanks for the quick response and suggestion Ryan. This particular project requires separate tree's, but I'm sure the LanguageSupportPageNames module will come in handy some day! Guess I'll need to modify the Multisite module then?
  2. Hey all, I'm developing a multilingual website with the following tree structure: - root - en - about-us - nl - over-ons But, because "nl" is the main language, I want to set the "nl" page as the website root (essentially stripping out the "/nl/" part within URLs). For example: http://www.website.nl/over-ons/ = page found http://www.website.nl/nl/over-ons/ = page not found http://www.website.nl/en/about-us/ = page found http://www.website.nl/about-us/ = page not found Is this possible with ProcessWire or do I need to modify Apeisa's Multisite module to enable this functionality? Greetings, Niek
  3. Ok, I've bought the ProCache module (developer version) and it's working great with Nginx! I'm willing to share my Nginx configuration directives for other people if that's okay with you Ryan?
  4. Hey Ryan, Any news regarding Nginx support? I would love to help out if possible Greetings, Niek
  5. Hey all, I've converted the ProcessWire 2.3 rules to Nginx. Hope this will help some people Greetings, Niek server { listen 80; listen 443 ssl; root /var/www/example.com/public_html; server_name example.com www.example.com; ssl_certificate /etc/pki/tls/certs/example.com.crt; ssl_certificate_key /etc/pki/tls/private/example.com.key; client_max_body_size 50m; access_log /var/www/example.com/_logs/access.log; error_log /var/www/example.com/_logs/error.log; # ----------------------------------------------------------------------------------------------- # Set default directory index files # ----------------------------------------------------------------------------------------------- index index.php index.html index.htm; # ----------------------------------------------------------------------------------------------- # Optional: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://processwire.com/ would be redirected to http://www.processwire.com/ # ----------------------------------------------------------------------------------------------- if ($host !~* ^www\.) { rewrite ^(.*)$ $scheme://www.$host$1 permanent; } # ----------------------------------------------------------------------------------------------- # Access Restrictions: Protect ProcessWire system files # ----------------------------------------------------------------------------------------------- # Block access to ProcessWire system files location ~ \.(inc|info|module|sh|sql)$ { deny all; } # Block access to any file or directory that begins with a period location ~ /\. { deny all; } # Block access to protected assets directories location ~ ^/(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) { deny all; } # Block acceess to the /site/install/ directory location ~ ^/(site|site-[^/]+)/install($|/.*$) { deny all; } # Block dirs in /site/assets/ dirs that start with a hyphen location ~ ^/(site|site-[^/]+)/assets.*/-.+/.* { deny all; } # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php location ~ ^/(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ { deny all; } # Block access to any PHP-based files in /templates-admin/ location ~ ^/(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP or markup files in /site/templates/ location ~ ^/(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP files in /site/assets/ location ~ ^/(site|site-[^/]+)/assets($|/|/.*\.php)$ { deny all; } # Block access to any PHP files in core or core module directories location ~ ^/wire/(core|modules)/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any PHP files in /site/modules/ location ~ ^/(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any software identifying txt files location ~ ^/(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ { deny all; } # Block all http access to the default/uninstalled site-default directory location ~ ^/site-default/ { deny all; } # ----------------------------------------------------------------------------------------------- # If the request is for a static file, then set expires header and disable logging. # Give control to ProcessWire if the requested file or directory is non-existing. # ----------------------------------------------------------------------------------------------- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|eot|woff|ttf)$ { expires 24h; log_not_found off; access_log off; try_files $uri $uri/ /index.php?it=$uri&$args; } # ----------------------------------------------------------------------------------------------- # This location processes all other requests. If the request is for a file or directory that # physically exists on the server, then load the file. Else give control to ProcessWire. # ----------------------------------------------------------------------------------------------- location / { try_files $uri $uri/ /index.php?it=$uri&$args; } # ----------------------------------------------------------------------------------------------- # Pass .php requests to fastcgi socket # ----------------------------------------------------------------------------------------------- location ~ \.php$ { # Check if the requested PHP file actually exists for security try_files $uri =404; # Fix for server variables that behave differently under nginx/php-fpm than typically expected fastcgi_split_path_info ^(.+\.php)(/.+)$; # Set environment variables include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Pass request to php-fpm fastcgi socket fastcgi_pass unix:/var/run/example.com_fpm.sock; } }
  6. Thanks Ryan, that sounds like a good solution!
  7. Hey all, Our website is targeted by a spambot, and now we're getting hundreds of CSRF Exception e-mails. I do like the Exception logging and the CSRF protection, so would it be possible to only disable the CSRF notifications? Greetings, Niek
  8. Hey Doolak! Yes this is intended behaviour. I'll explain what the module does: 1. When a page is saved with the news_article template, the module will find the first parent page that isn't a year/month/day template (in this case: News). 2. Then it'll create the year/month/day templates under that parent page, and move the news_article into it (in this case: it'll create the 2013 year archive under News, and move the Lorem Ipsum news_article into it). 3. After the news_article is moved, the module will cleanup empty year/month/day archives (in this case: it'll delete the Recent News and Archive pages because you've told the module that they are year archives, and they are cleaned up because they're empty). If you want to retain the Recent News and Archive pages, you should create an different template for the year archives, like "news_year_archive" and tell the module to use this template for the year archives. Little example: - News (template=news) - 2013 (template=news_year_archive) - Lorem Ipsum (template=news_article) - Dolor Sit (template=news_article) - Recent News (template=news_overview) - Archive (template=news_overview) Although I'm not sure if you really need the Recent News and Archive pages (because News could already show the recent news, and the 2013 page is already an archive), but I hope this helps u
  9. Hey Marty, No need to do that manually, you can put a little snippet in one of your templates to save the pages automatically (be sure to remove the snippet when you're done). Here is a little example: <?php foreach ($pages->find('template=news-item') as $item) { $item->save(); } ?>
  10. Maybe it would be possible to create a repository with ProcessWire profiles (with screenshots, color filtering etc.) for the non-technical people? This could be another selling point. Although I do think the profile installation process should be streamlined with a nice UI or something to make it successful.
  11. Well, all cache related settings are done through the admin UI at the moment, but maybe Ryan has a better opinion on this. I'm fine with both options. I've also updated the MarkupCache module to support the CacheName "PageSelector" format. MarkupCache.module
  12. Yeah I didn't really think about version compatibility, will try to do so in the future I've changed the $session->redirect argument from $page->path to $page->url, so it should be fixed now.
  13. Thanks for the report geniestreiche, I've removed the function array dereferencing from the module as it is only available in PHP 5.4+. Could u test if everything work now?
  14. Maybe u could say it like: Clear this cache "if a page is saved that matches this selector" But the main reason is that I think it would be easier to find a specific rule if all cache names are aligned at the left side
  15. I'm fine with those limitations/requirements and would be more than happy if u could integrate this functionality into the MarkupCache module Edit: Maybe it's an idea to switch the name and the selector? Think it would be easier to identify a rule if the name comes first. Especially if you have a bunch of them. Something like: TopNavigation "template=basic-page" HomeNewsSlider "template=news-item" Or: TopNavigation => template=basic-page HomeNewsSlider => template=news-item Some extra rows for the textarea field would also be nice. 5 rows seems to be a bit tiny.
  16. That's exactly what the regex functionality is for. The regex /^nav.two.(.*)/ would remove all related parts. This can be useful (for example) when caching the top navigation per page. Because the markup of the the top navigation is different for each page (because of the current/parent classnames) you could cache it per page with $cache->get("TopNavigation_" . $page->id). Then you could expire all all TopNavigation caches with the /^TopNavigation_(.*)/ regex when needed. It would also allow us to cache things for specific users $cache->get("TopNavigation_" . $user->id) or even $cache->get("TopNavigation_" . $user->id . "_" . $page->id).
  17. I'm glad u like it! The begin/end concept is something I remembered from working with the Yii Framework (very nice framework btw, with lots of cool concepts) so I thought: let's integrate that For the second part: I tried to put the rules on one line but I wasn't sure if I could get the parsing (what is the selector part, what is the name part and is the name a regex pattern?) right. It would be possible to check if the name begins with a non-alphanumeric, non-backslash, non-whitespace character (aka delimiter) to determine if it's a regex or not (and I'm oké with that), but if someone decides to begin a cache name with a "!" character (or similar) the rule would break. I also don't know if selectors can contain question marks, but if that's not the case and you're okay with the delimiter thing, then one rule per line would definitely be better.
  18. Yeah the configuration is a bit vague at the moment, but it works like this: The first line (uniqueName:) specifies the markup cache that should be expired when a page is saved that matches the selector on the second line (pageSelector:). Rule 1 (cache name or cache name regex) Rule 1 (page selector) Rule 2 (cache name or cache name regex) Rule 2 (page selector) ... If someone has a better idea then I would love to hear it. This is just one way to do it
  19. Hey all, I think it would be nice if the MarkupCache module could automatically expire specific caches when specific templates or pages are saved. This would allow us to cache heavy parts of a page for a very long time (or forever), and it'll only need to re-create the heavy part if its content has changed. It would also make sure no out-of-date content is shown. Advantages over the normal page cache are: - The normal page cache needs to re-render the whole page, this only needs to re-render the part that has changed (performance). - The normal page cache does not work with CSRF forms. I've coded a little proof-of-concept and I would like to hear if you guys have any suggestions or improvements. It works as following: Say you want to cache a news slider on the homepage: <?php if ( ! $data = $cache->get("HomeNewsSlider", 604800)) { // ... generate markup which uses the news-item template in $data ... $cache->save($data); } echo $data; ?> Then u would somehow configure the MarkupCache to expire the "HomeNewsSlider" cache when a page has been saved with the "news-item" template: This is how I have implemented it at the moment, but maybe someone has a better idea? I've also added a more convenient method (the begin() and end() methods) for caching markup: <?php if ($cache->begin("HomeNewsSlider", 604800)): ?> <h1><?=$page->title?></h1> // ... some other markup ... <?php $cache->end(); endif; ?> The module will start buffering the output when calling begin() and it'll save the buffer to the cache when calling end(). If the cache is available the begin() method will output the cached data. This way you wouldn't need to render all output to a $data variable. Hope u guys have some feedback or other/better ideas MarkupCache.module
  20. Thnx for the comments and tips guys! I've pushed some new changes: - Moved Site button from navigation to user actions. - Moving search bar to the left on mobile devices. - Changed PageList font-size to 12px for better readability. - Fixed translation issues. - Made PageListStatusHidden class a bit darker for better readability. - Removed automatic Javascript resize of title.
  21. ProcessDateArchiver ProcessWire Date Archiver Process Automatically archives pages based on a Datetime field (e.g. /news/2013/01/03/some-news-item/). Behavior - When you add a page with a specified template, the module will automatically create year/month/day archives for it. - When you change the date in a specified Datetime field, the page is automatically moved to the correct year/month/day archive. - When moving or trashing a page, the module will automatically clean up empty year, month and day archives. How to create an archiving rule 1. Go to the Setup -> Date Archiver screen in the ProcessWire admin. 2. Click on Add New Archiving Rule. 3. Specify the template that should be archived (typically the news-item template). 4. Specify the Datetime field that should be used to determine the date to archive by. 5. Specify the template that should be used for creating year archives. 6. Optionally specify the template that should be used for creating month archives. 7. Optionally specify the template that should be used for creating day archives. 8. Click Add Rule. Tips and tricks - Configure the archive templates that will contain other archives to sort its children by name. - Configure the archive template that will contain the news items to sort its children by the specified Datetime field. - You will improve usability if you dont allow the user to create date archives manually. How to Install 1. Install the module by placing ProcessDateArchiver.module in /site/modules/. 2. Check for new modules on the Modules screen in the ProcessWire admin. 3. Click Install for the Date Archiver Process. Module download: https://github.com/u...hive/master.zip Module project: https://github.com/u...ssDateArchiver/
  22. Nice! I've updated TinyMCE in the InputfieldTinyMCE module to version 3.5.8 and everything seems to work at first sight. Did some limited testing on Chrome OS-X with inserting images, links and basic styling.
  23. Are there any plans to upgrade the TinyMCE editor again in ProcessWire 2.3? The current solution works fine overall, but what I'm really missing are the webkit image resize handles (integrated since TinyMCE 3.5.5).
  24. Hey Titanium, thanks for the bug report! Seems like the tooltip functionality is only available in the 2.3 branch, guess I didn't test well enough on 2.2. Ive made the tooltip functionality conditional. Does this also fix your problem joshuag?
  25. Looks like a Javascript error. What browser are you using? And can u provide an error message (if there is any)?
×
×
  • Create New...